/* ThreadHouse Showcase Storefront Styles */

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

:root {
    --brand: #1B4332;
    --brand-light: #2D6A4F;
    --surface: #F9F6F1;
    --surface-alt: #F1ECE3;
    --border: #E4DDD4;
    --text: #1A1A1A;
    --muted: #6B6560;
    --price: #1B4332;
    --compare: #A08070;
    --badge-bg: #FFF3CD;
    --badge-text: #7D5A00;
    --success-bg: #F0FAF4;
    --success-border: #BBF7D0;
    --success-text: #166534;
    --danger-bg: #FEF2F2;
    --danger-border: #FECACA;
    --danger-text: #991B1B;
    --radius: 10px;
}

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--surface);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

[hidden] {
    display: none !important;
}

/* ------------------------------------------------------------------ */
/* Nav                                                                */
/* ------------------------------------------------------------------ */
.nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-logo {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    color: var(--brand);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 22px;
    list-style: none;
}

.nav-links a {
    font-size: 14px;
    color: var(--muted);
    text-decoration: none;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a.active {
    color: var(--brand);
    font-weight: 600;
    border-bottom-color: var(--brand);
}

.nav-cart {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.nav-cart:hover {
    border-color: var(--brand);
    background: #fff;
}

.nav-cart.has-items {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* ------------------------------------------------------------------ */
/* Collection view                                                    */
/* ------------------------------------------------------------------ */
.collection {
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 24px 80px;
}

.collection-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 28px;
}

.collection-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-light);
    margin-bottom: 8px;
}

.collection-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.7px;
    line-height: 1.15;
    margin-bottom: 8px;
}

.collection-lede {
    font-size: 15.5px;
    color: var(--muted);
    max-width: 560px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.filter-pill:hover {
    border-color: var(--brand);
    color: var(--text);
}

.filter-pill.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 980px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.card-media {
    display: block;
    position: relative;
    aspect-ratio: 4 / 5;
    background: #E8E0D6;
    overflow: hidden;
    text-decoration: none;
}

.card-media svg {
    width: 100%;
    height: 100%;
    display: block;
}

.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
}

.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--brand-light);
    margin-bottom: 4px;
}

.card-title {
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 6px;
    display: block;
}

.card-title:hover {
    color: var(--brand);
}

.card-desc {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
    flex: 1;
}

.card-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.card-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--price);
}

.card-compare {
    font-size: 13px;
    color: var(--compare);
    text-decoration: line-through;
}

.card-stock {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}

.card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.card-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: 1.5px solid var(--brand);
    transition: opacity 0.15s, background 0.15s;
}

.card-btn-primary {
    background: var(--brand);
    color: #fff;
}

.card-btn-primary:hover {
    opacity: 0.9;
}

.card-btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.card-btn-outline {
    background: #fff;
    color: var(--brand);
}

.card-btn-outline:hover {
    background: var(--surface);
}

.trade-banner {
    margin-top: 36px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.trade-banner h2 {
    font-size: 17px;
    margin-bottom: 4px;
}

.trade-banner p {
    font-size: 13.5px;
    color: var(--muted);
}

/* ------------------------------------------------------------------ */
/* Breadcrumb & PDP                                                   */
/* ------------------------------------------------------------------ */
.breadcrumb {
    padding: 14px 24px;
    font-size: 12.5px;
    color: var(--muted);
    max-width: 1120px;
    margin: 0 auto;
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--text);
}

.breadcrumb span {
    margin: 0 6px;
}

.pdp {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px 64px;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 48px;
    align-items: start;
}

@media (max-width: 780px) {
    .pdp {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .nav-links {
        display: none;
    }
}

.gallery {
    position: sticky;
    top: 74px;
}

.gallery-main {
    width: 100%;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    background: #E8E0D6;
    overflow: hidden;
    position: relative;
}

.gallery-main svg {
    width: 100%;
    height: 100%;
    display: block;
}

.gallery-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.gallery-thumb {
    width: 60px;
    height: 72px;
    border-radius: 6px;
    background: #D9D0C5;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    padding: 0;
}

.gallery-thumb.active {
    border-color: var(--brand);
}

.gallery-thumb svg {
    width: 100%;
    height: 100%;
    display: block;
}

.info {
    padding-top: 8px;
}

.info-brand {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-light);
    margin-bottom: 8px;
}

.info-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.4px;
    margin-bottom: 12px;
}

.info-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.stars {
    color: #E8A000;
    letter-spacing: 1px;
}

.info-pricing {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 22px;
}

.price-current {
    font-size: 28px;
    font-weight: 700;
    color: var(--price);
}

.price-compare {
    font-size: 16px;
    color: var(--compare);
    text-decoration: line-through;
}

.price-badge {
    font-size: 12px;
    font-weight: 600;
    background: #FEE2E2;
    color: #B91C1C;
    padding: 3px 8px;
    border-radius: 20px;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

.picker-label {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.picker-label span.picker-hint {
    font-weight: 400;
    color: var(--muted);
    font-size: 12.5px;
}

.size-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.size-btn {
    min-width: 52px;
    padding: 0 12px;
    height: 40px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: #fff;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    color: var(--text);
}

.size-btn:hover {
    border-color: var(--brand);
}

.size-btn.selected {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.size-btn.oos {
    border-style: dashed;
    color: var(--muted);
}

.size-btn.oos.selected {
    background: #6B6560;
    border-color: #6B6560;
    color: #fff;
}

.stock-status {
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.stock-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16A34A;
    flex-shrink: 0;
}

.stock-dot.oos {
    background: #DC2626;
}

.cta-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}

.btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: var(--brand);
    color: #fff;
}

.btn-primary.is-oos {
    background: #6B6560;
}

.btn-outline {
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.pdp-inline-alert {
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

.details-section {
    margin-top: 22px;
}

details {
    border-top: 1px solid var(--border);
    padding: 14px 0;
}

details:last-child {
    border-bottom: 1px solid var(--border);
}

summary {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::after {
    content: "+";
    font-size: 18px;
    color: var(--muted);
}

details[open] summary::after {
    content: "−";
}

.details-body {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.7;
    margin-top: 10px;
}

.details-body ul {
    padding-left: 18px;
}

.details-body li {
    margin-bottom: 4px;
}

.delivery-strip {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--success-text);
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.related-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 24px 80px;
    border-top: 1px solid var(--border);
}

.related-heading {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 780px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* Trade sign-up view                                                 */
/* ------------------------------------------------------------------ */
.home {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

.home-hero {
    padding: 64px 0 40px;
    max-width: 640px;
}

.home-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-light);
    margin-bottom: 12px;
}

.home-title {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.8px;
    margin-bottom: 16px;
}

.home-lede {
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 24px;
}

.home-cta-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--success-text);
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 8px;
    padding: 10px 14px;
}

.home-plans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 40px;
    max-width: 640px;
}

.home-plan {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.home-plan h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.home-plan p {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
}

.home-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

.home-shop-link {
    display: inline-block;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    border: 1.5px solid var(--brand);
    border-radius: 8px;
}

.home-shop-link:hover {
    background: var(--brand);
    color: #fff;
}

@media (max-width: 780px) {
    .home-title {
        font-size: 30px;
    }
    .home-plans {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------ */
/* Cart Drawer                                                        */
/* ------------------------------------------------------------------ */
.cart-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 18, 0.42);
    z-index: 40;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    background: #fff;
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.14);
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.cart-drawer-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-drawer-title {
    font-size: 17px;
    font-weight: 700;
}

.cart-close-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

.cart-close-btn:hover {
    color: var(--text);
    border-color: var(--text);
}

.cart-notice {
    margin: 12px 20px 0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.cart-notice.error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.cart-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--muted);
}

.cart-empty p {
    font-size: 14px;
    margin-bottom: 16px;
}

.cart-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.cart-item-thumb {
    width: 60px;
    height: 75px;
    border-radius: 6px;
    overflow: hidden;
    background: #E8E0D6;
}

.cart-item-thumb svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.cart-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.cart-item-title:hover {
    color: var(--brand);
}

.cart-item-line-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--price);
    white-space: nowrap;
}

.cart-item-meta {
    font-size: 12.5px;
    color: var(--muted);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    width: 28px;
    height: 26px;
    border: none;
    background: var(--surface);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.qty-btn:hover {
    background: var(--surface-alt);
}

.qty-val {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

.cart-remove-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
}

.cart-remove-btn:hover {
    color: var(--danger-text);
}

.cart-coupon-pill {
    margin-top: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cart-coupon-remove {
    background: none;
    border: none;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    font-weight: 700;
}

.cart-drawer-foot {
    border-top: 1px solid var(--border);
    padding: 16px 20px 20px;
    background: var(--surface);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 6px;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    margin-bottom: 14px;
}

.cart-foot-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.cart-checkout-note {
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--brand);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
}

/* ------------------------------------------------------------------ */
/* Footer & banners                                                   */
/* ------------------------------------------------------------------ */
.footer {
    text-align: center;
    padding: 32px 24px;
    font-size: 12.5px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer a {
    color: var(--muted);
}

#widget-load-error {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 460px;
}

.banner-dismiss {
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
}

#store-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1A1A1A;
    color: #fff;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 8px;
    z-index: 60;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}
