/* =====================================================
   PRODUCT DETAILS PAGE - Specific Styles
   ===================================================== */

/* PRODUCT SECTION */
.product-section {
    padding: 30px 0 50px;
    background: #fff;
    overflow-x: hidden;
    /* Prevent horizontal scrolling from zoom elements */
}

/* GALLERY */
.product-gallery {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.sticky-gallery {
    position: sticky;
    top: 90px;
    z-index: 5;
}

.product-gallery .thumbnail-rail {
    width: 70px;
}

.thumbnail-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: var(--bg-light);
    flex-shrink: 0;
    transition: border-color var(--transition-fast);
}

.thumbnail:hover {
    border-color: var(--primary-light);
}

.thumbnail.active {
    border-color: var(--primary);
}

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

.product-gallery .main-area {
    flex: 1;
    position: relative;
}

.main-image-container {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.main-image {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
    cursor: zoom-in;
}

/* MODERN ZOOM - Amazon/Flipkart Style */
.zoom-container {
    position: relative;
    display: inline-block;
    line-height: 0;
    cursor: crosshair;
}

.zoom-lens {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid #ff9800;
    background: rgba(255, 152, 0, 0.15);
    pointer-events: none;
    display: none;
    z-index: 50;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: opacity 0.1s ease;
}

.zoom-result {
    position: fixed;
    top: 0;
    left: 0;
    width: min(450px, calc(100vw - 32px));
    height: min(450px, calc(100vh - 32px));
    background-repeat: no-repeat;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    display: none;
    z-index: 1000;
    background-color: white;
    overflow: hidden;
    pointer-events: none;
}

/* Active zoom state */
.zoom-container:hover .zoom-lens {
    display: block;
}

.zoom-container.zoom-active .zoom-result {
    display: block;
    animation: zoomFadeIn 0.2s ease;
}

@keyframes zoomFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom indicator icon */
.zoom-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    pointer-events: none;
}

.zoom-container:hover .zoom-indicator {
    opacity: 0;
}

.custom-fullscreen-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    overflow: hidden;
}

.custom-modal-content {
    max-width: 92vw;
    max-height: 92vh;
    width: auto;
    height: auto;
}

.custom-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 2001;
}

.modal-open-custom {
    overflow: hidden;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
    z-index: 10;
}

.slider-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.slider-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* GALLERY ACTIONS */
.gallery-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

.btn-add-to-cart.custom,
.btn-buy-now.custom {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    min-width: 160px;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-add-to-cart.custom {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.btn-add-to-cart.custom:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
    opacity: 1;
}

.btn-add-to-cart.custom:disabled {
    background: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-buy-now.custom {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-buy-now.custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

.btn-wishlist.custom {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    transition: all 0.2s;
}

.btn-wishlist.custom:hover {
    background: #fff5f5;
    border-color: #ff4757;
    color: #ff4757;
}

.btn-wishlist.custom.active {
    background: #ff4757;
    border-color: #ff4757;
    color: white;
}

/* RIGHT COLUMN - PRODUCT INFO */
.product-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    padding: 5px 10px;
    background: #fffbeb;
    border-radius: 16px;
    border: 1px solid rgba(255, 193, 7, 0.2);
    width: auto;
}

.product-rating i {
    color: var(--accent);
    font-size: 13px;
}

.product-rating span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    margin-left: 4px;
}

.product-price {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(40, 167, 69, 0.15);
}

.product-price #product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

/* rupee symbol is now included in HTML */

.product-price .original-price {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* rupee symbol is now included in HTML */

.product-description {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

/* VARIANT SECTIONS */
.variant-section {
    margin-bottom: 14px;
    padding: 12px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.variant-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Combined Color & Size Row Layout */
.color-size-row {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    align-items: flex-start;
}

.color-picker,
.size-picker {
    display: flex;
    flex-direction: column;
}

.variant-title #selected-color-name,
.variant-title #selected-size-name {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 11px;
}

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

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: transform var(--transition-fast);
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    box-shadow: 0 0 0 2px var(--primary);
}

.color-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.size-option {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-fast);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
}

.size-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.size-option.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.size-option span {
    pointer-events: none;
}

.size-option.out-of-stock {
    opacity: 0.4;
    cursor: not-allowed;
    position: relative;
}

.size-option.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--text-muted);
    transform: rotate(-45deg);
}

.size-option.active::before {
    content: '✓';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    color: white;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.size-option.needs-setup {
    border-style: dashed;
    border-color: var(--primary-light);
    background: #f8fff8;
}

.size-option.needs-setup:hover {
    border-color: var(--primary);
    background: #e8f5e9;
}

/* Size available but requires color change */
.size-option.different-color {
    border-style: dashed;
    opacity: 0.85;
}



.variant-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
}

.variant-option {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    cursor: pointer;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: all var(--transition-fast);
}

.variant-option:hover:not(.disabled) {
    border-color: var(--primary-light);
    background: #f8fff8;
}

.variant-option.active {
    border-color: var(--primary);
    background: #e8f5e9;
}

.variant-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.variant-content {
    display: flex;
    align-items: center;
    gap: 5px;
}

.variant-content .color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.variant-content .age-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
}

.variant-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.variant-stock .badge {
    font-size: 9px;
    padding: 2px 5px;
}

/* QUANTITY */
.quantity-group.inline {
    display: inline-flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: 5px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.quantity-group.inline .qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.quantity-group.inline .qty-btn:hover {
    background: var(--primary);
    color: white;
}

.quantity-group.inline .quantity-input {
    width: 40px;
    height: 24px;
    border: none;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    background: white;
}

.quantity-group.inline .quantity-input:focus {
    outline: none;
}

/* PRODUCT META */
.product-meta {
    margin-top: 14px;
}

/* DELIVERY AND PAYMENT ROW */
.delivery-payment-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.delivery-options {
    flex: 0 0 auto;
    width: 220px;
    padding: 10px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.delivery-options h5 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

/* Icon is already in HTML, no pseudo-element needed */

.pincode-check {
    display: flex;
    gap: 4px;
}

.pincode-check input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    min-width: 0;
}

.pincode-check input:focus {
    outline: none;
    border-color: var(--primary);
}

.pincode-check button {
    padding: 5px 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.payment-options {
    flex: 1;
    padding: 10px;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.payment-options h5 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

/* Icon is already in HTML, no pseudo-element needed */

.payment-methods {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.payment-method i {
    font-size: 12px;
    color: var(--primary);
}

.payment-method.cod i {
    color: #28a745;
}

/* MODERN DELIVERY & OFFER ROW */
.delivery-offer-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.info-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.info-card:hover {
    border-color: #fca311;
    box-shadow: 0 4px 12px rgba(252, 163, 17, 0.08);
}

/* Delivery Card */
.delivery-card {
    flex: 1.2;
    display: flex;
    flex-direction: column;
}

.card-header-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.card-header-mini i {
    color: #fca311;
    font-size: 14px;
}

.pincode-input-group {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    position: relative;
}

.pincode-input-group input {
    width: 100%;
    padding: 8px 10px;
    padding-right: 60px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: border-color 0.2s;
}

.pincode-input-group input:focus {
    outline: none;
    border-color: #fca311;
}

.pincode-input-group button {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    border: none;
    background: #14213d;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 0 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.pincode-input-group button:hover {
    background: #fca311;
    color: #000;
}

.delivery-result {
    margin-top: 8px;
    font-size: 11px;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid #28a745;
}

.delivery-date-range {
    font-weight: 700;
    color: #28a745;
    margin-bottom: 2px;
}

.delivery-message {
    color: #666;
    margin-bottom: 4px;
}

.delivery-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.delivery-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #444;
}

.saved-location-mini {
    margin-top: 8px;
    font-size: 10px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Offer Card */
.offer-card {
    flex: 1;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
    border-color: #fce588;
}

.offer-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #d97706;
    margin-bottom: 4px;
}

.offer-discount {
    font-size: 20px;
    font-weight: 800;
    color: #b45309;
    line-height: 1;
    margin-bottom: 6px;
}

.offer-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px dashed #d97706;
}

.offer-code-row code {
    font-size: 11px;
    color: #000;
    font-weight: 700;
}

.copy-btn-mini {
    border: none;
    background: none;
    padding: 0;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.copy-btn-mini:hover {
    color: #000;
}

/* Features Card */
.features-card {
    flex: 0.8;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #444;
}

.feature-item i {
    font-size: 14px;
}

/* Attributes & Categories Row */
.attributes-categories-row {
    display: flex;
    gap: 20px;
    border-top: 1px solid #eee;
    font-size: 12px;
}

.attributes-column {
    flex: 1.5;
}

.categories-column,
.tags-column {
    flex: 1;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

.attributes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.attribute-item {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 4px 10px;
    border-radius: 4px;
    color: #333;
}

/* TABS SECTION */
.tabs-section {
    padding: 40px 0;
    background: #fff;
    border-top: 1px solid var(--border-light);
}

.nav-tabs {
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 20px;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary);
    border-color: transparent;
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.tab-pane {
    color: var(--text-secondary);
    line-height: 1.6;
}

.tab-pane h4 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* REVIEWS */
.review-item {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

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

/* RESPONSIVE */
@media (max-width: 991px) {
    .product-gallery {
        flex-direction: column-reverse;
    }

    .product-gallery .thumbnail-rail {
        width: 100%;
        height: auto;
    }

    .thumbnail-container {
        flex-direction: row;
        max-height: none;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .thumbnail {
        width: 50px;
        height: 50px;
    }

    .main-image {
        max-height: 300px;
    }

    .sticky-gallery {
        position: static;
        top: auto;
    }

    /* Hide desktop zoom elements on mobile to prevent overflow */
    .zoom-lens,
    .zoom-result {
        display: none !important;
    }

    .zoom-container {
        cursor: default;
    }
}

@media (max-width: 768px) {
    .product-section {
        padding-top: 0;
    }

    .sticky-gallery {
        position: static;
        z-index: 1;
    }

    .delivery-offer-row {
        flex-direction: column;
    }

    .attributes-categories-row {
        flex-direction: column;
        gap: 10px;
    }

    .categories-column,
    .tags-column {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }

    /* Mobile specific button layout */
    .gallery-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .btn-add-to-cart.custom,
    .btn-buy-now.custom {
        width: 100%;
        min-width: unset;
        padding: 14px;
    }

    .btn-wishlist.custom {
        width: 100%;
        height: auto;
        border-radius: 8px;
        padding: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        border: 1px solid #ddd;
        font-weight: 600;
        font-size: 14px;
    }

    .mobile-product-header .product-title {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    .mobile-product-header .product-rating {
        margin-bottom: 0;
    }
}
