* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-font: "Urbanist", sans-serif;
    --secondary-font: "Playfair Display", serif;
    --text-color: #85827C;
    --base-color: #4A4845;
    --heading-color: #2D2C2A;
    --primary-color: #BD986B;
    --hover-color: #D4B9A3;
}

/* Base Styles */
body {
    font-family: var(--primary-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #FEFCFA;
    margin-top: 90px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--primary-font);
    font-weight: 400;
    color: var(--heading-color);
}

/* Layout */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: transparent;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 32px 14px;
    background: transparent;
}

/* Product Container */
.product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin: 0 auto;
    padding: 0px 20px;
    gap: 40px;
    align-items: start;
}

.media-grid, .product-details {
    min-width: 0; /* Prevent overflow */
}

/* Media Grid - Updated for Image Swapping */
.media-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-image-container {
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 8px;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Horizontal Thumbnail Slider */
.thumbnail-slider-container {
    position: relative;
    width: 100%;
}

.thumbnail-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #8B5E3C transparent;
}

.thumbnail-slider::-webkit-scrollbar {
    height: 4px;
}

.thumbnail-slider::-webkit-scrollbar-track {
    background: transparent;
}

.thumbnail-slider::-webkit-scrollbar-thumb {
    background-color: #8B5E3C;
    border-radius: 2px;
}

.thumbnail-slide {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.thumbnail-slide.active {
    border-color: #8B5E3C;
}

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

/* Slider Navigation Buttons */
.slider-nav {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.slider-nav.prev {
    left: 8px;
}

.slider-nav.next {
    right: 8px;
}

.slider-nav:hover {
    background: white;
}

.thumbnail-slider-container:hover .slider-nav {
    display: block;
}

/* Product Details */
.details-box {
    padding: 64px 32px;
    width: 100%;
}

h1 {
    font-size: 24px;
    margin: 0 0 8px;
}

.short-description {
    font-size: 16px;
    color: var(--text-color);
    margin: 0 0 24px;
}

.section-title {
    font-size: 14px;
    margin: 0 0 8px;
}

#info-description {
    padding: 16px;
    color: #676560;
    background-color: #FAF5EE;
    border: solid 1px #F4ECE3;
    border-radius: 4px;
}

/* Selection Options */
.size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-options {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.color-option {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background-color: transparent;
    transition: all 0.2s ease;
}

.size-option {
    width: auto;
    height: auto;
    padding: 16px 12px;
    border: 1px solid #ddd;
    border-radius: 30px;
    cursor: pointer;
    background-color: transparent;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    line-height: 0px;
    color: #85827C;
}

/* Update active state for size options */
.size-option.active {
    background-color: #2D2C2A;
    color: #FEFCFA;
    font-weight: 400;
    border-color: var(--primary-color);
}

#custom-size-btn{
    display: none;
}
.color-option {
    border-radius: 50%;
    position: relative;
}

.color-option.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #BD986B;
    border-radius: 50%;
}

/* Add to Cart Button */
.add-to-cart {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 32px;
    width: 100%;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.add-to-cart .cart-text,
.add-to-cart .cart-price {
    font-size: 15px;
    font-weight: 500;
}

.add-to-cart:hover {
    background-color: #905B33;
}

/* product.css */
.add-to-cart.disabled {
    background-color: #f1d9bd !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.selection-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    display: none;
}

/* Highlight unselected options when error shows */
.selection-error.visible + .color-options,
.selection-error.visible + .size-options,
.selection-error.visible + .length-options {
    outline: 1px solid #e74c3c;
    border-radius: 4px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.tab-button {
    background: none;
    border: none;
    font-size: 16px;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
    position: relative;
    padding-bottom: 8px;
}

.tab-button.active {
    color: var(--heading-color);
    font-weight: 605000;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

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

.cart-notification {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85); /* Semi-transparent light base */
    backdrop-filter: blur(10px); /* Creates the frosted glass effect */
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    color: var(--primary-color); /* Using your primary color for text */
    padding: 12px 24px;
    border-radius: 12px; /* More rounded corners for modern look */
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.1), /* Soft shadow */
        inset 0 0 0 1px rgba(255, 255, 255, 0.3); /* Inner light border */
    z-index: 999;
    opacity: 0;
    transition: all 0.3s ease;
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border */
}

.cart-notification.show {
    opacity: 1;
    top: 100px;
}

.cart-icon {
    position: relative;
    display: inline-block;
}

#cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: var(--primary-color);
    color: white;
    font-size: 12px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 2px;
}

/* Custom Size Toggle */
.custom-size-toggle-container {
    margin-bottom: 48px;
}

.custom-size-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.custom-size-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.custom-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.custom-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.custom-field label {
    font-size: 14px;
    color: var(--text-color);
}

.custom-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.required-fields-note {
    font-size: 13px;
    color: var(--light-text);
    margin-top: 8px;
    font-style: italic;
}

.custom-size-note {
    font-size: 13px;
    color: var(--error-color);
    margin-top: 12px;
}

/* Animation for custom fields */
.custom-size-fields {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-details {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Dress length specific styles */
.dress-length-selection {
    margin-top: 24px;
    margin-bottom: 24px;
}

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

.length-option {
    width: auto;
    height: auto;
    padding: 16px 12px;
    border: 1px solid #ddd;
    border-radius: 30px;
    cursor: pointer;
    background-color: transparent;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    line-height: 0px;
    color: #85827C;
}

.length-option.active {
    background-color: #2D2C2A;
    color: #FEFCFA;
    font-weight: 400;
    border-color: var(--primary-color);
}

/* Custom size toggle styling */
.custom-size-toggle-container {
    margin: 24px 0;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.custom-size-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: var(--heading-color);
}

.custom-size-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

/* Error styling for custom inputs */
.custom-input.error {
    border-color: #e74c3c !important;
    background-color: #fff5f5;
}

/* Smooth transitions */
#standard-size-options,
.custom-size-fields {
    transition: all 0.3s ease;
}

/* Required field indicators */
.section-title[data-required]::after {
    content: "*";
    color: #e74c3c;
    margin-left: 4px;
}

/* Size Chart Link */
.size-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.size-chart-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-family: var(--primary-font);
    transition: color 0.2s ease;
}

.size-chart-link:hover {
    color: var(--hover-color);
}

/* Size Chart Modal */
.size-chart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.size-chart-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: #FEFCFA;
    border-radius: 16px;
    padding: 40px 32px 32px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--heading-color);
}

.modal-title {
    font-family: var(--secondary-font);
    font-size: 24px;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 32px;
    font-weight: 400;
}

.size-table-container {
    overflow-x: auto;
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.size-table th,
.size-table td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.size-table th {
    font-weight: 600;
    color: var(--heading-color);
    background: #f9f9f9;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.size-table tr:last-child td {
    border-bottom: none;
}

.size-table tr:hover td {
    background: #fafafa;
}

/* Out of stock start here*/

/* Remove image overlay completely */
.out-of-stock-overlay {
    display: none !important;
}

/* Out of stock color options - simple muted with slash */
.color-option.out-of-stock {
    position: relative;
    opacity: 0.4;
    cursor: not-allowed;
}

/* Subtle muted slash in brand color */
.color-option.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 1.5px;
    background: #8B5E3C; /* Brand color */
    opacity: 0.5; /* Muted */
    transform: translate(-50%, -50%) rotate(45deg);
    display: block !important; /* Ensure slash shows */
}

/* Remove the white overlay border */
.color-option.out-of-stock::before {
    display: none; /* Remove this completely */
}

/* Keep same opacity on hover */
.color-option.out-of-stock:hover {
    opacity: 0.4; /* Don't change on hover */
}

/* Remove badge */
.out-of-stock-badge {
    display: none;
}

/* Hide all stock text */
.stock-status,
.stock-available,
.stock-out,
.out-of-stock-message {
    display: none !important;
}

/* Selected in-stock color */
.color-option.selected:not(.out-of-stock) {
    border: 2px solid #2D2C2A !important;
    box-shadow: 0 0 0 1px #2D2C2A !important;
}

/* Selected out of stock color */
.color-option.selected.out-of-stock {
    border: 2px solid rgba(139, 94, 60, 0.3) !important;
    box-shadow: 0 0 0 1px rgba(139, 94, 60, 0.1) !important;
    opacity: 0.5;
}

/* In stock colors full opacity */
.color-option:not(.out-of-stock) {
    opacity: 1;
}

/* Main image container */
.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 8px;
}

/* OUT OF STOCK text label */
.out-of-stock-label {
    font-family: var(--primary-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.8px;
    color: #8B5E3C;
    text-transform: uppercase;
    margin-top: 8px;
    display: none; /* Hidden by default */
}

/* Disabled button styling */
.add-to-cart.disabled[title="This color is out of stock"] {
    background-color: #F4ECE3 !important;
    color: #A58F86 !important;
    cursor: not-allowed;
    border: 1px solid #E3C8B0;
}

.product-info-tabs {
    margin-bottom: 120px;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

.tab-headers {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    position: relative;
}

.tab-header {
    background: none;
    border: none;
    padding: 0 0 12px 0;
    font-family: var(--primary-font);
    font-size: 16px;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.tab-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.tab-header.active {
    color: var(--heading-color);
    font-weight: 500;
}

.tab-header.active::after {
    background-color: var(--primary-color);
}

.tab-header:hover:not(.active) {
    color: var(--base-color);
}

.tab-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.size-guide-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s ease;
}

.size-guide-link:hover {
    color: var(--hover-color);
}

/* Tablet and Mobile */
@media (max-width: 1024px) {
    .product-container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0px 16px;
    }

    .details-box {
        padding: 16px 8px;
    }

    .main-image-container {
        height: 900px;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .thumbnail {
        height: 100px;
    }

    .size-option,
    .length-option {
        font-size: 14px;
    }

    .add-to-cart {
        gap: 12px;
        padding: 16px;
    }

    .add-to-cart .cart-text,
    .add-to-cart .cart-price {
        font-size: 16px;
    }

    .tab-headers {
       gap: 24px;
    }
    
    .tab-header {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .thumbnail-slide {
        width: 100px;
        height: 100px;
    }
    
    .slider-nav {
        display: block;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .thumbnail-slider-container:hover .slider-nav {
        opacity: 1;
    }

    .modal-content {
        padding: 32px 20px 24px;
        margin: 20px;
        max-height: 85vh;
    }
    
    .modal-title {
        font-size: 20px;
        margin-bottom: 24px;
    }
    
    .size-table th,
    .size-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .modal-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    .product-info-tabs {
        margin-bottom: 120px;
        padding-top: 24px;
    }
    
    .tab-headers {
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .tab-header {
        font-size: 16px;
        padding-bottom: 10px;
    }
    
    .tab-content {
        font-size: 14px;
    }
}

/* Mobile Only */
@media (max-width: 600px) {
    h1 {
        font-size: 20px;
    }

    .short-description {
        font-size: 14px;
    }

    .main-image-container {
        height: 380px;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .thumbnail {
        height: 80px;
    }

    .size-options,
    .color-options,
    .length-options {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .tabs {
        flex-direction: column;
        gap: 8px;
    }

    .cart-notification {
        top: 80px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 28px 16px 20px;
    }
    
    .size-table {
        font-size: 12px;
    }
    
    .size-table th,
    .size-table td {
        padding: 10px 6px;
    }
    
    .size-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    
    .size-chart-link {
        align-self: flex-end;
        margin: 0 0 8px;
        text-align: center;
    }

    .tab-headers {
        gap: 16px;
    }
    
    .tab-header {
        font-size: 14px;
    }

    .add-to-cart {
        gap: 12px;
        padding: 16px;
        margin-bottom: 20px;
    }

    .product-info-tabs {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    }
}

/* Animation for image swap */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.main-image-container img {
    animation: fadeIn 0.5s ease;
}