/* ============================================
   Product Detail Page Styles
   ============================================ */

.product-detail-page {
    padding: 40px 0 80px;
    background-color: var(--white);
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

/* ============================================
   Product Images Section
   ============================================ */

.product-images-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--light-gray);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

/* Hover-to-zoom effect for main product image */
.main-product-image {
    cursor: zoom-in;
    overflow: hidden;
    position: relative;
}

.main-product-image img {
    transition: transform 0.1s ease-out;
    transform-origin: center center;
    will-change: transform;
}

.product-thumbnails {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.thumbnail-item {
    aspect-ratio: 1;
    background-color: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail-item:hover {
    border-color: var(--primary-purple);
    transform: translateY(-3px);
}

.thumbnail-item.active {
    border-color: var(--primary-purple);
    box-shadow: 0 4px 12px rgba(88, 45, 78, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Product Info Section
   ============================================ */

.product-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-category-tag {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin: 0;
    font-family: 'Montserrat', sans-serif;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.product-price .old-price {
    font-size: 20px;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-price .new-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-purple);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.product-rating .stars {
    display: flex;
    gap: 3px;
}

.product-rating .star {
    font-size: 20px;
    color: var(--light-gray);
}

.product-rating .star.filled {
    color: var(--primary-purple);
}

.product-rating .rating-text {
    font-size: 14px;
    color: var(--text-light);
}

.product-category-info {
    font-size: 15px;
    color: var(--text-dark);
    margin: 10px 0;
}

.product-category-info span:last-child {
    color: var(--primary-purple);
    font-weight: 600;
}

.product-description {
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.6;
    margin: 20px 0;
}

.product-quantity {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
}

.product-quantity label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 2px solid var(--primary-purple);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(88, 45, 78, 0.1);
}

.quantity-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, var(--primary-purple) 0%, #6b4470 100%);
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
    overflow: hidden;
}

.quantity-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-pink) 0%, var(--primary-purple) 100%);
    transition: left 0.3s ease;
    z-index: 0;
}

.quantity-btn:hover::before {
    left: 0;
}

.quantity-btn > * {
    position: relative;
    z-index: 1;
}

.quantity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 45, 78, 0.3);
    color: var(--white);
}

.quantity-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(88, 45, 78, 0.2);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--light-gray);
    color: var(--text-meta);
}

#quantityInput {
    width: 80px;
    height: 50px;
    border: none;
    border-left: 2px solid var(--primary-purple);
    border-right: 2px solid var(--primary-purple);
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-purple);
    background-color: var(--white);
    outline: none;
    padding: 0;
    -moz-appearance: textfield;
    font-family: 'Montserrat', sans-serif;
}

#quantityInput::-webkit-outer-spin-button,
#quantityInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#quantityInput:focus {
    background-color: var(--light-gray-alt);
    border-color: var(--secondary-pink);
}

.product-actions {
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.btn-add-cart {
    flex: 1;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-green) 0%, #848967 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-add-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #848967 0%, var(--primary-green) 100%);
    transition: left 0.3s ease;
    z-index: 0;
}

.btn-add-cart:hover::before {
    left: 0;
}

.btn-add-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 112, 79, 0.3);
}

.btn-add-cart svg,
.btn-add-cart span {
    position: relative;
    z-index: 1;
}

.btn-buy-now {
    flex: 1;
    padding: 16px 30px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-purple) 0%, #6b4470 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-buy-now::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-pink) 0%, var(--primary-purple) 100%);
    transition: left 0.3s ease;
    z-index: 0;
}

.btn-buy-now:hover::before {
    left: 0;
}

.btn-buy-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 45, 78, 0.3);
}

.btn-buy-now svg,
.btn-buy-now span {
    position: relative;
    z-index: 1;
}

.product-actions-secondary {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
}

.action-link {
    font-size: 15px;
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.action-link:hover {
    color: var(--primary-purple);
}

.action-link svg {
    width: 16px;
    height: 16px;
}

.product-delivery-info {
    margin: 20px 0;
    padding: 20px;
    background-color: var(--light-gray);
    border-radius: 8px;
}

.product-delivery-info p {
    margin: 8px 0;
    font-size: 15px;
    color: var(--text-dark);
}

.product-delivery-info p:first-child {
    font-weight: 600;
}

.product-payment-info {
    margin: 20px 0;
}

.product-payment-info p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.payment-methods {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.payment-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.payment-logo:hover {
    opacity: 1;
}

/* ============================================
   Product Tabs Section
   ============================================ */

.product-tabs-section {
    margin-top: 60px;
    border-top: 2px solid var(--light-gray);
    padding-top: 40px;
}

.product-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--light-gray);
    margin-bottom: 30px;
}

.tab-btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-light);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    top: 2px;
}

.tab-btn:hover {
    color: var(--primary-purple);
}

.tab-btn.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}

.tab-content {
    display: none;
    padding: 30px 0;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.tab-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 25px 0 15px;
}

.tab-content p {
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.8;
    margin-bottom: 15px;
}

.tab-content ul {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.tab-content ul li {
    font-size: 16px;
    color: var(--text-body);
    line-height: 1.8;
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
}

.tab-content ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-purple);
    font-weight: bold;
}

.product-ingredients {
    margin-top: 30px;
}

.product-ingredients ul {
    margin-top: 15px;
}

/* ============================================
   Reviews Section
   ============================================ */

.reviews-list {
    margin: 30px 0;
}

.review-item {
    display: flex;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid var(--light-gray);
}

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

.review-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-light);
}

.review-content {
    flex: 1;
}

.review-rating {
    display: flex;
    gap: 3px;
    margin-bottom: 10px;
}

.review-rating .star {
    font-size: 16px;
    color: var(--light-gray);
}

.review-rating .star.filled {
    color: var(--primary-purple);
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.review-author {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.review-date {
    font-size: 14px;
    color: var(--text-light);
}

.review-text {
    font-size: 15px;
    color: var(--text-body);
    line-height: 1.6;
}

.review-form-section {
    margin-top: 40px;
    padding: 30px;
    background-color: var(--light-gray);
    border-radius: 12px;
}

.review-form-note {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 25px;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.rating-input {
    display: flex;
    gap: 5px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-input input[type="radio"] {
    display: none;
}

.star-label {
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    display: inline-block;
    position: relative;
    user-select: none;
    width: 36px;
    height: 36px;
    text-align: center;
}

/* Filled star overlay (hidden by default) */
.star-label::after {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    color: var(--primary-green);
    opacity: 0;
    transition: opacity 0.3s ease;
    line-height: 1;
    z-index: 2;
}

/* Hide outline star when checked - show filled star instead */
.rating-input input[type="radio"]:checked ~ .star-label,
.rating-input input[type="radio"]:checked + .star-label {
    color: transparent !important;
}

/* Show filled star when checked */
.rating-input input[type="radio"]:checked ~ .star-label::after,
.rating-input input[type="radio"]:checked + .star-label::after {
    opacity: 1 !important;
}

/* Show filled star on hover (preview) */
.rating-input .star-label:hover::after,
.rating-input .star-label:hover ~ .star-label::after {
    opacity: 0.8;
}

/* Change outline star color on hover */
.rating-input .star-label:hover,
.rating-input .star-label:hover ~ .star-label {
    color: var(--primary-green);
    transform: scale(1.15);
}

/* When checked, ensure filled star is visible and outline is hidden */
.rating-input input[type="radio"]:checked ~ .star-label:hover,
.rating-input input[type="radio"]:checked + .star-label:hover {
    color: transparent !important;
}

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="email"] {
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-dark);
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group textarea:focus,
.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus {
    outline: none;
    border-color: var(--primary-purple);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-body);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   Related Products Section
   ============================================ */

.related-products-section {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 2px solid var(--light-gray);
}

.related-products-section .section-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 40px;
    text-align: center;
}

/* ============================================
   Notification
   ============================================ */

.product-detail-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-purple);
    color: var(--white);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 350px;
}

.product-detail-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .product-thumbnails {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-add-cart,
    .btn-buy-now {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .product-detail-page {
        padding: 20px 0 60px;
    }
    
    .product-detail-layout {
        gap: 30px;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .product-price .new-price {
        font-size: 24px;
    }
    
    .product-thumbnails {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .product-quantity {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .product-actions-secondary {
        flex-direction: column;
        gap: 15px;
    }
    
    .product-tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab-btn {
        border-bottom: 2px solid var(--light-gray);
        border-left: 3px solid transparent;
        text-align: left;
    }
    
    .tab-btn.active {
        border-left-color: var(--primary-purple);
        border-bottom-color: var(--light-gray);
    }
    
    .payment-methods {
        justify-content: center;
    }
    
    .review-form-section {
        padding: 20px;
    }
}

