/**
 * Eternal Tailor Customizer Styles
 * ===========================
 * Consolidated CSS for product customization
 * Prepared for future multi-step implementation
 *
 * @version 1.0.0
 * @date 2025-09-29
 */

/* ========================================
   Base Customizer Styles
   ======================================== */

.customizer-container {
    min-height: 600px;
    position: relative;
}

/* Size Selection Styles */
/* Size box — navy solid (was gradient) */
.size-box-gradient {
    background: #1e3a5f;
    position: relative;
    overflow: hidden;
}

.size-box-gradient::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: #C9A96E;
    border-radius: inherit;
    opacity: 0;
    z-index: -1;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.5; }
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Custom Size Modal Styles */
.custom-size-modal {
    max-height: 70vh;
    overflow-y: auto;
}

.custom-size-modal input[type="number"] {
    -moz-appearance: textfield;
}

.custom-size-modal input[type="number"]::-webkit-outer-spin-button,
.custom-size-modal input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Customization Option Cards */
.customization-option {
    cursor: pointer;
}

/* Navy/gold active state for customization option cards */
.customization-option.selected {
    border-color: #1e3a5f;
    background-color: rgba(30, 58, 95, 0.03);
}

/* Image Gallery Styles */
.product-gallery {
    position: sticky;
    top: 80px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.thumbnail-button {
    aspect-ratio: 4/5;
    overflow: hidden;
    border-radius: 0.25rem;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.thumbnail-button:hover,
.thumbnail-button:focus {
    border-color: #1e3a5f;
}

.thumbnail-button.active {
    border-color: #1e3a5f;
}

/* Form Validation Styles */
.field-error {
    border-color: #EF4444 !important;
    background-color: #FEE2E2 !important;
}

.error-message {
    color: #DC2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #1e3a5f;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Multi-Step Styles
   ======================================== */

/* Modern Step Progress Bar with Line Through Circles */
.step-progress-container {
    display: block;
    margin: 2rem 0;
    padding: 1rem 0;
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin: 0 auto;
    max-width: 600px; /* Increased from 400px to fit more steps */
}

/* Background line connecting all steps */
.step-indicators::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: #E5E7EB;
    z-index: 1;
    border-radius: 2px;
}

/* Progress line that fills as user advances */
.step-indicators::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    height: 3px;
    background: #1e3a5f;
    z-index: 2;
    border-radius: 2px;
    transition: width 0.4s ease;
    width: var(--progress-width, 0%);
}

.step-indicator {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 13.5px;
    height: 13.5px;
    border-radius: 50%;
    background: #F3F4F6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.375rem;
    color: #9CA3AF;
    transition: all 0.3s ease;
    position: relative;
}

/* Larger dots on tablet and desktop */
@media (min-width: 768px) {
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 0.688rem;
    }
}

/* Scale down circles when there are 10+ steps to prevent crowding */
.step-indicators:has(.step-indicator:nth-child(n+10)) .step-number {
    width: 10px;
    height: 10px;
    font-size: 0.3rem;
}

@media (min-width: 768px) {
    .step-indicators:has(.step-indicator:nth-child(n+10)) .step-number {
        width: 18px;
        height: 18px;
        font-size: 0.5rem;
    }
}

.step-number:hover {
    background: #e8dfd3;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(30, 58, 95, 0.15);
}

/* Active step styling */
.step-indicator.active .step-number {
    background: #C9A96E;
    color: #1e3a5f;
    transform: scale(1.1);
}

/* Completed step styling */
.step-indicator.completed .step-number {
    background: #1e3a5f;
    color: white;
}

/* Checkmark for completed steps */
.step-indicator.completed .step-number::after {
    content: '✓';
    position: absolute;
    font-size: 0.75rem;
    font-weight: 700;
    color: white; /* Ensure checkmark is visible on gradient background */
}

/* Smaller checkmark for 10+ steps */
.step-indicators:has(.step-indicator:nth-child(n+10)) .step-indicator.completed .step-number::after {
    font-size: 0.5rem;
    color: white; /* Ensure checkmark stays visible */
}

@media (min-width: 768px) {
    .step-indicators:has(.step-indicator:nth-child(n+10)) .step-indicator.completed .step-number::after {
        font-size: 0.65rem;
        color: white; /* Ensure checkmark stays visible */
    }
}

/* Hide number when showing checkmark - use color instead of font-size for better compatibility */
.step-indicator.completed .step-number {
    font-size: 0 !important; /* Override any size rules */
    color: transparent;
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Step Navigation */
.step-navigation {
    display: block; /* Enabled for multi-step */
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #E5E7EB;
}

.step-nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
}

.step-nav-button {
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-decoration: none;
}

.step-nav-button.prev {
    background: transparent;
    border: 1.5px solid #1e3a5f;
    color: #1e3a5f;
    padding: 0.7rem 1.5rem;
}

.step-nav-button.prev:hover {
    background: #1e3a5f;
    color: white;
}

.step-nav-button.next {
    background: #1e3a5f;
    border: 1.5px solid #1e3a5f;
    color: white;
    padding: 0.7rem 2rem;
    margin-left: auto;
}

.step-nav-button.next:hover {
    background: #152d4a;
    border-color: #152d4a;
}

/* WhatsApp inquiry button (replaces Add to Cart submit) */
.step-nav-button.submit {
    background: #25D366;
    border: 1.5px solid #25D366;
    color: white;
    padding: 0.7rem 2rem;
    margin-left: auto;
    font-weight: 600;
}

.step-nav-button.submit:hover {
    background: #1ebe57;
    border-color: #1ebe57;
}

.step-nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Review Step Styles */
.review-section {
    background: #F9F5F1;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.review-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1F2937;
}

.review-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #E5E7EB;
}

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

.review-item-label {
    color: #6B7280;
    font-size: 0.875rem;
}

.review-item-value {
    color: #1F2937;
    font-weight: 500;
}

/* Review edit button — navy with gold hover */
.review-edit-button {
    color: #1e3a5f;
    font-size: 0.875rem;
    text-decoration: underline;
    cursor: pointer;
}

.review-edit-button:hover {
    color: #C9A96E;
}

/* ========================================
   Mobile Responsive Styles
   ======================================== */

@media (max-width: 768px) {
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .customization-option {
        padding: 0.75rem;
    }

    /* Multi-step mobile adjustments */
    .step-progress-container {
        margin: 1rem 0;
        padding: 0.5rem 0;
    }

    .step-indicators {
        max-width: 100%;
        margin: 0 1rem;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .step-indicator.active .step-number {
        transform: scale(1.05); /* Smaller scale on mobile */
    }


    .review-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    /* Nav buttons: smaller on mobile */
    .step-nav-button {
        font-size: 0.8rem;
        padding: 0.55rem 1rem;
    }

    .step-nav-button.next {
        padding: 0.55rem 1.2rem;
    }

    .step-nav-button.submit {
        padding: 0.55rem 1.2rem;
        font-size: 0.8rem;
    }

    .step-nav-button.submit svg {
        width: 16px;
        height: 16px;
    }

    /* Single-step WhatsApp button */
    .single-step-navigation .whatsapp-inquiry-btn {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 640px) {
    .thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.transition-all {
    transition: all 0.3s ease;
}

.no-scroll {
    overflow: hidden;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease;
}

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

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .step-navigation,
    .step-progress-container,
    .thumbnail-grid,
    button {
        display: none !important;
    }

    .step-content {
        display: block !important;
    }
}