/* ============================================
   PREMIUM CONFIGURATOR - SHOPIFY STYLE
   ============================================ */

:root {
    /* Colors */
    --primary: #e49492;
    --primary-dark: #d17876;
    --primary-light: #f5d5d4;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --success: #10b981;
    --success-light: #d1fae5;
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    /* Typography */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

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

body {
    margin: 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ============================================
   HEADER
   ============================================ */

.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
}

.site-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.eyebrow {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.tagline {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}


/* ============================================
   MAIN LAYOUT - SPLIT VIEW
   ============================================ */

.configurator {
    min-height: calc(100vh - 200px);
    background: var(--bg-secondary);
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 480px;
    min-height: calc(100vh - 200px);
}


/* Left side - Sticky product view */

.product-image-section {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
}

.product-photo {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    min-height: 500px;
}

.product-photo__base {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    filter: saturate(0) brightness(0.95);
    position: relative;
    z-index: 1;
}

.product-photo__fallback {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    color: #666;
    font-size: 1.2rem;
    font-weight: bold;
}

.product-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}


/* Product description at bottom */

.product-description {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-xl);
}

.product-description h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.product-description p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.variant-previews {
    display: flex;
    gap: var(--space-lg);
}

.variant-preview {
    flex: 1;
}

.variant-preview__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
    display: block;
}

.strap-preview,
.carabiner-preview {
    display: flex;
    gap: var(--space-xs);
}

.strap-preview img,
.carabiner-preview img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 2px solid var(--border-light);
}


/* Right side - Configuration panel */

.configuration-panel {
    background: var(--bg-secondary);
    overflow-y: auto;
    height: 100vh;
    padding: var(--space-2xl) var(--space-xl);
}


/* ============================================
   CONFIG STEPS - ACCORDION
   ============================================ */

.config-step {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.config-step:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
}

.config-step--active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.config-step__header {
    width: 100%;
    background: none;
    border: none;
    padding: var(--space-lg);
    text-align: left;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: var(--space-md);
    transition: background-color 0.2s ease;
}

.config-step__header:hover {
    background: var(--bg-tertiary);
}

.config-step--active .config-step__header {
    background: linear-gradient(135deg, #fef5f5 0%, #ffffff 100%);
}

.config-step__number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.config-step--active .config-step__number {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.config-step__title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.config-step__label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.config-step__selected {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.config-step--active .config-step__selected {
    color: var(--primary);
}

.config-step__arrow {
    font-size: 1.25rem;
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

.config-step--active .config-step__arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.config-step__content {
    padding: 0 var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border-light);
    display: none;
    animation: slideDown 0.3s ease;
}

.config-step--active .config-step__content {
    display: block;
}

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

.config-step__content>p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}


/* ============================================
   LENGTH OPTIONS - CHIPS
   ============================================ */

.length-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.chip {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip:hover {
    border-color: var(--primary-light);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chip--active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fef5f5 0%, #ffffff 100%);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.chip__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.chip__description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}


/* ============================================
   COLOR MODE TOGGLE
   ============================================ */

.color-mode {
    display: inline-flex;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 4px;
    margin-bottom: var(--space-lg);
}

.color-mode label {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.color-mode input {
    display: none;
}

.color-mode input:checked+label,
.color-mode label:has(input:checked) {
    background: var(--bg-primary);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}


/* ============================================
   COLOR SLOTS
   ============================================ */

.color-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.color-slot {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.color-slot:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.color-slot--active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fef5f5 0%, #ffffff 100%);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.color-slot.is-hidden {
    display: none;
}

.color-slot strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.color-slot span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.color-slot--active span {
    color: var(--primary);
    font-weight: 500;
}


/* ============================================
   COLOR PICKER MODAL
   ============================================ */

.color-picker {
    margin-top: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

.color-picker__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.color-picker__header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.color-picker__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.color-picker__close:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: rotate(90deg);
}

.card-grid--color-picker {
    padding: var(--space-lg);
    max-height: 400px;
    overflow-y: auto;
}


/* ============================================
   COLOR & CARABINER CARDS
   ============================================ */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.card-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.card {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card--selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.card--selected::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: bold;
}

.card__media {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--space-sm);
    background: var(--bg-tertiary);
}

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

.card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    text-align: center;
}

.card__meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.card--selected .card__meta {
    color: var(--primary);
    font-weight: 500;
}


/* ============================================
   ORDER SUMMARY
   ============================================ */

.order-summary {
    background: linear-gradient(135deg, #fef5f5 0%, #ffffff 100%);
    border: 2px solid var(--primary-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.price-card {
    margin-bottom: var(--space-lg);
}

.price-card__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.price-card__total span {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.price-card__total strong {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.price-breakdown {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-md);
}

.price-breakdown li {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

.price-breakdown li:last-child {
    border-bottom: none;
}

.small-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.selection-summary {
    margin-bottom: var(--space-lg);
    padding: var(--space-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
}

.selection-summary p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.selection-summary strong {
    color: var(--text-primary);
}

.summary-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}


/* ============================================
   PRIMARY CTA BUTTON
   ============================================ */

.primary-cta {
    width: 100%;
    padding: var(--space-lg) var(--space-xl);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.primary-cta::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.primary-cta:hover::before {
    width: 300px;
    height: 300px;
}

.primary-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.primary-cta:active {
    transform: translateY(0);
}


/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-xl);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}


/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 1024px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
    .product-image-section {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .product-photo {
        min-height: 50vh;
        padding: var(--space-xl);
    }
    .product-photo__base {
        max-height: 50vh;
    }
    .configuration-panel {
        height: auto;
    }
}

@media (max-width: 768px) {
    .length-options {
        grid-template-columns: 1fr;
    }
    .color-slots {
        grid-template-columns: 1fr;
    }
    .variant-previews {
        flex-direction: column;
    }
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .config-step__header {
        grid-template-columns: auto 1fr auto;
    }
    .config-step__selected {
        display: none;
    }
    .product-photo {
        min-height: 40vh;
        padding: var(--space-lg);
    }
    .product-photo__base {
        max-height: 40vh;
    }
}

@media (max-width: 480px) {
     :root {
        font-size: 14px;
    }
    .site-header {
        padding: var(--space-lg);
    }
    .configuration-panel {
        padding: var(--space-lg);
    }
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .product-photo {
        min-height: 35vh;
        padding: var(--space-md);
    }
    .product-photo__base {
        max-height: 35vh;
    }
}


/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.configuration-panel::-webkit-scrollbar,
.card-grid--color-picker::-webkit-scrollbar {
    width: 8px;
}

.configuration-panel::-webkit-scrollbar-track,
.card-grid--color-picker::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.configuration-panel::-webkit-scrollbar-thumb,
.card-grid--color-picker::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

.configuration-panel::-webkit-scrollbar-thumb:hover,
.card-grid--color-picker::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}


/* ============================================
   LOADING STATES
   ============================================ */

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

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}