/* ============================================================
   HCC Custom Jockstrap Configurator — style.css
   Hustle City Clothing. Thoughtfully Inappropriate Apparel.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Roboto+Mono:wght@400;700&display=swap');

/* ── Custom Fonts — band text canvas rendering only ───────── */
@font-face {
    font-family: 'Basic Bitch';
    src: url('https://cdn.shopify.com/s/files/1/0782/4474/1348/files/font-basic-bitch.woff2?v=1775096606') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Threes Company';
    src: url('https://cdn.shopify.com/s/files/1/0782/4474/1348/files/font-threes-company.woff2?v=1775096606') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Boomer';
    src: url('https://cdn.shopify.com/s/files/1/0782/4474/1348/files/font-boomer.woff2?v=1775096606') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Murder She Wrote';
    src: url('https://cdn.shopify.com/s/files/1/0782/4474/1348/files/font-murder-she-wrote.woff2?v=1775096606') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Cumdump';
    src: url('https://cdn.shopify.com/s/files/1/0782/4474/1348/files/font-cumdump.woff2?v=1775096606') format('woff2');
    font-display: swap;
}

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --red:           #FF3131;
    --black:         #000000;
    --white:         #FFFFFF;
    --surface-dark:  #0F0F0F;
    --surface-mid:   #1A1A1A;
    --border:        #2A2A2A;
    --font-heading:  'Bungee', Impact, sans-serif;
    --font-ui:       'Roboto Mono', 'Courier New', monospace;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--black);
    color: var(--white);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.4;
    height: 100%;
    overflow: hidden;
}

/* ── Two-column layout ──────────────────────────────────────── */
.configurator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    overflow: hidden;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Viewer column ──────────────────────────────────────────── */
.viewer-col {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 20px 24px 24px;
    background-color: var(--surface-dark);
    height: 100vh;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

/* ── Visual box ─────────────────────────────────────────────── */
.visual-box {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: calc(100vh - 48px);
    max-width: calc(100vh - 48px);
    overflow: hidden;
    background-color: #0a0a0a;
    outline: 1px solid var(--border);
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    display: block;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    position: absolute;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.85));
}

.badge--waist {
    bottom: 6%;
    left: 4%;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge__icon--waist {
    width: clamp(28px, 5vw, 54px);
    height: auto;
    display: block;
    flex-shrink: 0;
    filter: invert(1);
}

.badge__waist-text {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: clamp(16px, 2.8vw, 28px);
    color: var(--white);
    text-shadow: 0 1px 6px rgba(0,0,0,0.95);
    letter-spacing: 0.02em;
    line-height: 1;
}

.badge--pouch {
    bottom: 6%;
    right: 4%;
    display: flex;
    align-items: center;
}

.badge__pouch-wrap {
    position: relative;
    width: clamp(37px, 6.6vw, 70px);
    height: clamp(37px, 6.6vw, 70px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge__icon--pouch {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: invert(1);
}

.badge__pouch-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: clamp(10px, 1.65vw, 18px);
    color: var(--white);
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}

/* ── Controls panel ─────────────────────────────────────────── */
.controls {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--black);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.controls::-webkit-scrollbar { width: 4px; }
.controls::-webkit-scrollbar-track { background: transparent; }
.controls::-webkit-scrollbar-thumb { background-color: var(--border); border-radius: 2px; }

/* ── Section base ───────────────────────────────────────────── */
.section {
    border-bottom: 1px solid var(--border);
}

.section__heading {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(18px, 2.4vw, 28px);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 14px 20px;
    line-height: 1.1;
}

.section__body {
    padding: 20px;
}

/* ── Section: CHOOSE YOUR FIT ───────────────────────────────── */
.section--fit {
    background-color: var(--red);
}

.section--fit .section__heading {
    color: var(--white);
    background-color: var(--red);
    border-bottom: 1px solid rgba(255,255,255,0.22);
}

.section--fit .section__body {
    background-color: var(--red);
    padding: 22px 20px;
}

.section__subtitle {
    font-family: var(--font-ui);
    font-size: clamp(13px, 1.4vw, 16px);
    color: var(--white);
    padding: 0 20px 14px;
    opacity: 0.88;
}

.fit-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fit-field--pouch {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.22);
}

.fit-label {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: clamp(12px, 1.5vw, 15px);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--white);
}

.fit-unit {
    display: block;
    font-weight: 400;
    font-size: 0.8em;
    text-transform: none;
    opacity: 0.78;
    margin-top: 1px;
}

.fit-desc {
    font-family: var(--font-ui);
    font-size: clamp(12px, 1.3vw, 14px);
    color: rgba(255,255,255,0.82);
    line-height: 1.5;
}

.fit-input {
    width: 100%;
    padding: 10px 12px;
    background-color: rgba(0,0,0,0.28);
    border: 2px solid rgba(255,255,255,0.55);
    border-radius: 5px;
    color: var(--white);
    font-family: var(--font-ui);
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.fit-input::placeholder {
    color: rgba(255,255,255,0.45);
    font-weight: 400;
}

.fit-input:focus {
    border-color: var(--white);
    background-color: rgba(0,0,0,0.45);
}

.fit-hint {
    font-family: var(--font-ui);
    font-size: clamp(10px, 1.1vw, 12px);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.58);
}

.fit-select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    background-color: rgba(0,0,0,0.28);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 2px solid rgba(255,255,255,0.55);
    border-radius: 5px;
    color: var(--white);
    font-family: var(--font-ui);
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 700;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease;
}

.fit-select:focus {
    border-color: var(--white);
}

.fit-select option {
    background-color: #1a1a1a;
    color: var(--white);
}

/* ── Section: FABRIC ────────────────────────────────────────── */
.swatch-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.swatch {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0 0 4px;
    cursor: pointer;
    background: var(--surface-mid);
    overflow: hidden;
    transition: border-color 0.12s ease, transform 0.1s ease;
}

.swatch:hover {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.35);
}

.swatch--selected {
    border-color: var(--red);
    box-shadow: 0 0 0 1px var(--red);
}

.swatch__img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.swatch__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.swatch__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--red);
    color: var(--white);
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1.4;
    pointer-events: none;
    white-space: nowrap;
}

.swatch__label {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    color: rgba(255,255,255,0.75);
    padding: 4px 3px 0;
    line-height: 1.2;
    width: 100%;
    overflow: hidden;
    max-height: 2.4em;
}

.swatch--selected .swatch__label {
    color: var(--white);
}

.fabric-message {
    margin-top: 14px;
    padding: 14px 16px;
    background-color: var(--surface-mid);
    border-left: 3px solid var(--red);
    border-radius: 0 5px 5px 0;
    font-family: var(--font-ui);
    font-size: clamp(13px, 1.4vw, 15px);
    color: var(--white);
    line-height: 1.6;
}

/* ── Section: BAND WIDTH ────────────────────────────────────── */
.pill-toggle {
    display: flex;
    gap: 0;
}

.pill {
    flex: 1;
    padding: 12px 16px;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: clamp(13px, 1.5vw, 16px);
    letter-spacing: 0.04em;
    border: 2px solid var(--border);
    background-color: var(--black);
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pill:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.pill:last-child {
    border-radius: 0 6px 6px 0;
}

.pill--active {
    background-color: var(--red);
    border-color: var(--red);
    color: var(--white);
}

/* ── Band text overlay (in visual viewer) ───────────────────── */
.band-text-overlay {
    position: absolute;
    z-index: 10;
    top: 25%;
    left: 8%;
    width: 84%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    text-align: center;
    pointer-events: none;
    letter-spacing: 0.06em;
    line-height: 1;
    white-space: nowrap;
    overflow: visible;
    transition: font-size 0.15s ease;
}

/* ── Section: FONT + BAND TEXT ──────────────────────────────── */
.section__price-badge {
    display: inline-block;
    background-color: var(--red);
    color: var(--white);
    font-family: var(--font-ui);
    font-size: 0.55em;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
    letter-spacing: 0.04em;
}

.section--disabled {
    opacity: 0.45;
    pointer-events: none;
}

.font-gate-msg {
    font-family: var(--font-ui);
    font-size: clamp(12px, 1.3vw, 14px);
    color: rgba(255,255,255,0.55);
    margin-bottom: 12px;
    font-style: italic;
}

.font-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.font-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0 0 4px;
    cursor: pointer;
    background: var(--surface-mid);
    transition: border-color 0.12s ease, transform 0.1s ease;
}

.font-swatch:hover:not(:disabled) {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.35);
}

.font-swatch--selected {
    border-color: var(--red);
    box-shadow: 0 0 0 1px var(--red);
}

.font-swatch:disabled {
    cursor: default;
}

.font-swatch img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    pointer-events: none;
    overflow: hidden;
    border-radius: 4px;
}

.font-swatch__label {
    font-family: var(--font-ui);
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    color: rgba(255,255,255,0.7);
    padding: 4px 3px 2px;
    line-height: 1.3;
    width: 100%;
}

.font-swatch--selected .font-swatch__label {
    color: var(--white);
}

/* ── Band text input block ──────────────────────────────────── */
.band-text-block {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.band-text-warning {
    font-family: var(--font-ui);
    font-size: clamp(11px, 1.2vw, 13px);
    color: rgba(255,255,255,0.65);
    line-height: 1.55;
    margin-bottom: 14px;
}

.band-text-input {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--surface-mid);
    border: 2px solid var(--border);
    border-radius: 5px;
    color: var(--white);
    font-family: var(--font-ui);
    font-size: clamp(15px, 1.8vw, 20px);
    font-weight: 700;
    outline: none;
    transition: border-color 0.15s ease;
}

.band-text-input:focus {
    border-color: var(--red);
}

.band-text-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.band-text-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.band-text-count {
    font-family: var(--font-ui);
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.04em;
}

.lock-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    background-color: var(--red);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-family: var(--font-heading);
    font-size: clamp(16px, 2vw, 22px);
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.lock-btn:hover {
    opacity: 0.88;
}

.lock-btn--locked {
    background-color: var(--surface-mid);
    border: 2px solid var(--border);
    color: rgba(255,255,255,0.6);
}

.addons-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
    align-items: center;
    margin-bottom: 16px;
}

.addon-pill,
.addon-empty {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.addon-pill {
    background-color: var(--red);
    color: var(--white);
}

.addon-empty {
    border: 1px solid var(--border);
    color: rgba(255,255,255,0.5);
}

.cart-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.sku-preview {
    font-family: var(--font-ui);
    font-size: clamp(13px, 1.5vw, 16px);
    font-weight: 700;
    color: rgba(255,255,255,0.62);
    letter-spacing: 0.04em;
}

.price-preview {
    font-family: var(--font-heading);
    font-size: clamp(24px, 3.5vw, 42px);
    color: var(--white);
    line-height: 1;
}

.quantity-row {
    display: grid;
    grid-template-columns: 46px minmax(72px, 1fr) 46px;
    gap: 8px;
    margin-top: 16px;
}

.quantity-btn,
.quantity-input,
.add-to-cart-btn {
    border-radius: 5px;
    font-family: var(--font-ui);
    font-weight: 700;
}

.quantity-btn {
    min-height: 46px;
    border: 2px solid var(--border);
    background-color: var(--surface-mid);
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
}

.quantity-input {
    min-width: 0;
    min-height: 46px;
    border: 2px solid var(--border);
    background-color: var(--black);
    color: var(--white);
    text-align: center;
    font-size: 18px;
    outline: none;
}

.quantity-input:focus {
    border-color: var(--red);
}

.cart-error {
    min-height: 20px;
    margin-top: 12px;
    color: var(--red);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.add-to-cart-btn {
    width: 100%;
    min-height: 54px;
    margin-top: 8px;
    border: none;
    background-color: var(--red);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: clamp(18px, 2.4vw, 26px);
    letter-spacing: 0.08em;
    cursor: pointer;
}

.add-to-cart-btn:hover,
.quantity-btn:hover {
    opacity: 0.88;
}

@media (max-width: 54rem) {
    :root {
        --mobile-edge: clamp(0.5rem, 3dvw, 0.875rem);
        --mobile-viewer-height: 48dvh;
    }

    html,
    body {
        height: 100%;
        min-height: 100%;
        overflow: hidden;
    }

    .configurator-wrapper {
        position: relative;
        display: block;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: hidden;
        overflow-x: hidden;
    }

    .viewer-col {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        height: var(--mobile-viewer-height);
        padding: var(--mobile-edge);
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .visual-box {
        width: min(
            calc(100dvw - (var(--mobile-edge) * 2)),
            calc(var(--mobile-viewer-height) - (var(--mobile-edge) * 2))
        );
        height: min(
            calc(100dvw - (var(--mobile-edge) * 2)),
            calc(var(--mobile-viewer-height) - (var(--mobile-edge) * 2))
        );
        max-width: none;
        max-height: none;
    }

    .controls {
        position: absolute;
        top: var(--mobile-viewer-height);
        right: 0;
        bottom: 0;
        left: 0;
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

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