/* Stock Status Styles */
.stock-info {
    margin: 12px 0;
}

.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
}

.stock-status.high-stock {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.stock-status.low-stock {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.stock-status.out-of-stock {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.stock-status i {
    font-size: 1rem;
}

/* Max quantity note */
.max-quantity-note {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* Disabled state for out of stock items */
.add-to-cart:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

.quantity-input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

/* Product Detail Container */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px auto;
    max-width: 1200px;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Product Gallery */
.product-gallery {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
}

.product-main-image {
    width: 100%;
    max-width: 450px;
    height: 350px;
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.4s ease;
    margin-bottom: 12px;
    cursor: zoom-in;
}

.product-main-image:hover {
    transform: scale(1.03);
}

/* Product Info Section */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 12px;
}

.product-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
    line-height: 1.2;
    flex: 1;
}

/* Rating Card in Product Info */
.product-rating-card {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
}

.product-rating-card .average-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-rating-card .rating-stars {
    color: #ffc107;
    font-size: 1rem;
    display: flex;
    gap: 2px;
}

.product-rating-card .average-rating-number {
    font-weight: bold;
    color: #2E5D50;
    font-size: 1.1rem;
}

.product-rating-card .review-count {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Price Container */
.price-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.product-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #dc3545;
    margin: 0;
}

.product-price.discounted {
    color: #2E5D50; /* Custom green color for discounted price */
    font-weight: 800;
}

.original-price {
    font-size: 1.4rem;
    color: #6c757d;
    text-decoration: line-through;
    font-weight: 500;
}

.discount-badge {
    background: #dc3545;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product Description */
.product-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 12px 0;
}

/* Selection Options */
.color-selection,
.size-selection,
.quantity-selection {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.color-selection h3,
.size-selection h3,
.quantity-selection h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-options,
.size-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Color Options with Names */
.color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: #f8f9fa;
    min-width: 70px;
}

.color-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-option.selected {
    border-color: #2E5D50;
    background: rgba(46, 93, 80, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 93, 80, 0.2);
}

/* Color Swatches */
.color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.color-option:hover .color-swatch {
    border-color: #2E5D50;
    box-shadow: 0 4px 16px rgba(46, 93, 80, 0.2);
}

.color-option.selected .color-swatch {
    border-color: #2E5D50;
    box-shadow: 0 0 0 3px rgba(46, 93, 80, 0.2);
}

.color-swatch::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.color-option.selected .color-swatch::after {
    opacity: 1;
}

/* Color Names */
.color-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    text-align: center;
    text-transform: capitalize;
    transition: color 0.3s ease;
    min-height: 18px;
    display: flex;
    align-items: center;
    max-width: 70px;
    word-wrap: break-word;
    line-height: 1.2;
}

.color-option.selected .color-name {
    color: #2E5D50;
    font-weight: 700;
}

/* Size Options */
.size-option {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    background: #ffffff;
    color: #495057;
    min-width: 50px;
    text-align: center;
}

.size-option:hover {
    border-color: #2E5D50;
    background: rgba(46, 93, 80, 0.05);
    transform: translateY(-2px);
}

.size-option.selected {
    background: #2E5D50;
    color: white;
    border-color: #2E5D50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 93, 80, 0.3);
}

.size-option.out-of-stock {
    opacity: 0.4;
    text-decoration: line-through;
    cursor: not-allowed;
    background: #f8f9fa;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 8px;
    width: fit-content;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #2E5D50;
    background: transparent;
    color: #2E5D50;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn:hover:not(:disabled) {
    background: #2E5D50;
    color: white;
    transform: scale(1.1);
}

.quantity-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: transparent;
    color: #adb5bd;
    border-color: #adb5bd;
    transform: none;
}

.quantity-input {
    width: 60px;
    text-align: center;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    background: white;
}

/* Product Actions */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.add-to-cart {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2E5D50 0%, #1E4D40 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    align-items: center;
    justify-content: center;

}

.add-to-cart {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2E5D50 0%, #1E4D40 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.add-to-cart:hover::before {
    left: 100%;
}

.add-to-cart:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 93, 80, 0.4);
}

.add-to-cart:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46, 93, 80, 0.3);
}

.add-to-cart:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-to-menu {
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    color: #2E5D50;
    border: 2px solid #2E5D50;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.back-to-menu:hover {
    background: #2E5D50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 93, 80, 0.2);
}

.back-to-menu:active {
    transform: translateY(0);
}

/* Reviews Section */
.product-reviews {
    margin-top: 3rem;
    padding: 2rem;
    border-top: 1px solid #eee;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: 1200px;
    margin: 30px auto;
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.reviews-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #f8f9fa;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
}

.rating-stars {
    color: #ffc107;
    font-size: 1.1rem;
    display: flex;
    gap: 2px;
}

.rating-value {
    font-weight: bold;
    font-size: 1.2rem;
    color: #2E5D50;
}

.review-count {
    color: #666;
    font-size: 0.9rem;
}

/* Review Form */
.review-form-container {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.review-form-container h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1.5rem;
}

.rating-input {
    margin-bottom: 1.5rem;
}

.rating-input label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.5rem;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3e%3cpath fill='%23ccc' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
    margin: 0;
    transition: all 0.2s ease;
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24'%3e%3cpath fill='%23ffc107' d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3e%3c/svg%3e");
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.3s ease;
    min-height: 120px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #2E5D50;
    box-shadow: 0 0 0 3px rgba(46, 93, 80, 0.1);
}

.review-form .btn-primary {
    background: linear-gradient(135deg, #2E5D50 0%, #1E4D40 100%);
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.review-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 93, 80, 0.3);
}

.login-prompt {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
}

.login-prompt p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

.login-prompt a {
    color: #2E5D50;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-prompt a:hover {
    color: #1E4D40;
    text-decoration: underline;
}

/* Reviews List */
.reviews-list {
    margin-top: 2rem;
}

.review-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.reviewer-name {
    font-weight: 700;
    color: #2E5D50;
    font-size: 1rem;
}

.review-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.review-rating {
    color: #ffc107;
    font-size: 0.9rem;
    display: flex;
    gap: 2px;
}

.review-comment {
    color: #495057;
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

.review-edited {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.5rem;
}

.no-reviews {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.no-reviews p {
    margin: 0;
    font-size: 1.1rem;
}

/* Button Styles */
.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    margin-left: 10px;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Ensure stars display properly */
.fas.fa-star, .fas.fa-star-half-alt {
    color: #ffc107; /* Yellow for filled stars */
}

.far.fa-star {
    color: #ddd; /* Gray for empty stars */
}

.product-rating-card .rating-stars .star-rating {
    color: #ffc107 !important;
    font-size: 1rem;
    letter-spacing: 1px;
    font-weight: normal;
    display: inline !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    gap: unset !important;
}

.rating-stars .star-rating {
    color: #ffc107 !important;
    font-size: 1rem;
    letter-spacing: 1px;
    display: inline !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    gap: unset !important;
}

/* Additional specificity for rating contexts */
.average-rating .star-rating,
.rating-display .star-rating {
    color: #ffc107 !important;
    font-size: 1rem;
    letter-spacing: 1px;
    display: inline !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    gap: unset !important;
}
.rating-stars .fas.fa-star, 
.rating-stars .fas.fa-star-half-alt {
    color: #ffc107 !important;
}

.rating-stars .far.fa-star {
    color: #ddd !important;
}

/* Animation for new reviews */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.review-item {
    animation: fadeInUp 0.5s ease-out;
}

/* Success message for review submission */
.review-success {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #c3e6cb;
    text-align: center;
    font-weight: 600;
}

/* Error message for review submission */
.review-error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-weight: 600;
}

/* Notification System */
.cart-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.cart-notification.success {
    background: #4CAF50;
}

.cart-notification.error {
    background: #f44336;
}

.cart-notification.warning {
    background: #ff9800;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Success Message */
.cart-success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-left: 5px solid #28a745;
    border-radius: 4px;
    margin: 20px 0;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 992px) {
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 12px;
    }
    
    .product-gallery {
        padding: 12px;
    }
    
    .product-main-image {
        height: 300px;
    }
    
    .product-title {
        font-size: 1.6rem;
    }
    
    .product-price {
        font-size: 1.4rem;
    }
    
    .product-reviews {
        padding: 1.5rem;
        margin: 20px auto;
    }
}

@media (max-width: 768px) {
    .product-detail-container {
        padding: 10px;
    }
    
    .product-main-image {
        height: 250px;
    }
    
    .product-title {
        font-size: 1.4rem;
    }
    
    .product-price {
        font-size: 1.2rem;
    }
    
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .review-form-container {
        padding: 1.5rem;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .product-main-image {
        height: 200px;
    }
    
    .product-title {
        font-size: 1.2rem;
    }
    
    .color-option {
        min-width: 60px;
    }
    
    .color-swatch {
        width: 30px;
        height: 30px;
    }
    
    .size-option {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .product-reviews {
        padding: 1rem;
    }
    
    .review-form-container {
        padding: 1rem;
    }
    
    .review-item {
        padding: 1rem;
    }
    
    .cart-notification {
        top: 70px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}