/**
 * MG Commerce - Product Detail Page Stylesheet
 */

/* Product Detail Layout */
.product-detail {
    padding: 40px 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Gallery */
.gallery-main {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: var(--secondary);
    cursor: zoom-in;
    aspect-ratio: 3/4;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-slide.active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.gallery-slide picture,
.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.thumb {
    width: 70px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s;
    border: 2px solid transparent;
    flex-shrink: 0;
}

.thumb:hover {
    opacity: 0.8;
}

.thumb.active {
    opacity: 1;
    border-color: var(--primary);
}

.thumb picture,
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s;
    z-index: 10;
}

.gallery-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev {
    left: 15px;
}

.gallery-next {
    right: 15px;
}

.gallery-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.zoom-hint {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-main:hover .zoom-hint {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.15s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

/* Product Info */
.product-category-link {
    color: var(--primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.product-title {
    font-size: 32px;
    margin: 15px 0 8px 0;
}

.product-sku {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    font-family: monospace;
}

/* Popularity Badges */
.popularity-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0 20px 0;
}

.pop-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    animation: pulse-soft 2s infinite;
}

.pop-badge i {
    font-size: 14px;
}

.pop-badge strong {
    font-weight: 700;
}

.pop-cart {
    background: rgba(123, 182, 157, 0.15);
    color: #2d8659;
}

.pop-eye {
    background: rgba(100, 149, 237, 0.15);
    color: #4169e1;
}

.pop-fire {
    background: rgba(255, 107, 107, 0.15);
    color: #e74c3c;
}

@keyframes pulse-soft {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.product-rating .stars {
    color: #ffc107;
}

.rating-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 700;
}

/* Price */
.product-price-detail {
    margin-bottom: 20px;
}

.product-price-detail .price-current {
    font-family: var(--font-price);
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.product-price-detail .price-old {
    font-size: 20px;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-right: 15px;
}

.product-short-desc {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.7;
}

/* Variant Section */
.variant-section {
    margin-bottom: 20px;
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.size-btn {
    padding: 12px 24px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.size-btn:hover {
    border-color: var(--primary);
}

.size-btn.selected {
    border-color: var(--primary);
    background: rgba(183, 110, 121, 0.1);
    color: var(--primary);
}

.color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.color-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
}

.color-btn:hover {
    border-color: #ddd;
}

.color-btn.selected {
    border-color: var(--primary);
    background: rgba(183, 110, 121, 0.05);
}

.color-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.color-btn.selected .color-circle {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px var(--primary);
}

.color-btn .color-name {
    font-size: 11px;
    color: #666;
}

.color-btn.selected .color-name {
    color: var(--primary);
    font-weight: 600;
}

/* Variant Error */
.variant-error-msg {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff3f3;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    color: #c62828;
    font-size: 14px;
    margin-bottom: 15px;
}

.variant-error-msg i {
    font-size: 18px;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease-in-out 2;
}

/* Variant Boxes */
.product-variants,
.product-quantity {
    margin-bottom: 20px;
}

.variant-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-box {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-width: 80px;
}

.variant-box:hover:not(.disabled) {
    border-color: var(--primary);
}

.variant-box.selected {
    border-color: var(--primary);
    background: rgba(183, 110, 121, 0.1);
}

.variant-box.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.variant-box .variant-name {
    display: block;
    font-weight: 500;
}

.variant-box .variant-stock {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

/* Product Actions */
.product-actions-detail {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.wishlist-btn-detail {
    padding: 15px 20px;
    border: 2px solid #ddd;
}

.wishlist-btn-detail i {
    font-size: 24px;
    color: #999;
}

.wishlist-btn-detail.active {
    border-color: #e74c3c;
    background: #fff;
}

.wishlist-btn-detail.active i {
    color: #e74c3c;
}

@media (hover: hover) {
    .wishlist-btn-detail:hover {
        border-color: #e74c3c;
    }

    .wishlist-btn-detail:hover i {
        color: #e74c3c;
    }
}

/* Stock Warning */
.stock-warning {
    color: var(--error);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Product Features */
.product-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: var(--secondary);
    border-radius: 12px;
}

.product-features .feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.product-features .feature i {
    color: var(--primary);
    font-size: 18px;
}

/* Product Sections */
.product-section {
    margin-top: 40px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
}

.section-heading {
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.product-description {
    line-height: 1.8;
    color: var(--text-secondary);
}

.no-content {
    color: var(--text-secondary);
    font-style: italic;
}

/* Reviews */
.review-item {
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.review-author {
    font-weight: 600;
}

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

.review-rating {
    color: #ffc107;
    margin-bottom: 10px;
}

.review-title {
    font-size: 15px;
    margin-bottom: 8px;
}

.review-comment {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Admin Reply */
.admin-reply {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f4f5 0%, #fdf9fa 100%);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
}

.admin-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.admin-reply-header i {
    color: var(--primary);
}

.admin-reply-header strong {
    color: var(--primary);
}

.admin-reply-header .reply-date {
    color: var(--text-secondary);
    margin-left: auto;
}

.admin-reply p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* WhatsApp button: raise above sticky cart bar on mobile product pages */
@media (max-width: 768px) {
    .whatsapp-btn {
        bottom: 160px !important;
    }
}