/* ASA storefront — minimal, fast, no framework. Replace with brand styles. */
:root {
    --brand: #1d5c3a;
    --brand-dark: #14422a;
    --text: #222;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); }
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
a { color: var(--brand); }

.site-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border);
}
.site-header .logo { font-size: 1.3rem; font-weight: 700; text-decoration: none; color: var(--brand-dark); }
.site-header nav a { margin-left: 1.25rem; text-decoration: none; }
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem; color: var(--muted); text-align: center; margin-top: 3rem; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.product-card { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; text-decoration: none; color: var(--text); }
.product-card:hover { border-color: var(--brand); }
.product-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.product-card h2 { font-size: 1rem; margin: 0.5rem 0 0.25rem; }
.price { font-weight: 700; color: var(--brand-dark); }
.badge.oos { color: #b91c1c; font-size: 0.85rem; }

.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .product-page { grid-template-columns: 1fr; } }
.product-images img { width: 100%; border-radius: 8px; }

fieldset.axis { border: none; padding: 0; margin: 1rem 0; }
fieldset.axis legend { font-weight: 600; margin-bottom: 0.4rem; }
.axis-option { display: inline-block; margin: 0 0.4rem 0.4rem 0; }
.axis-option input { position: absolute; opacity: 0; }
.axis-option span {
    display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--border);
    border-radius: 6px; cursor: pointer; user-select: none;
}
.axis-option input:checked + span { border-color: var(--brand); background: #ecf7f0; font-weight: 600; }
.axis-option.unavailable span { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; }

#add-btn, .checkout-btn {
    background: var(--brand); color: #fff; border: none; border-radius: 6px;
    padding: 0.75rem 2rem; font-size: 1rem; cursor: pointer; margin-top: 0.75rem;
}
#add-btn:disabled { background: var(--muted); cursor: not-allowed; }
.sku, .note { color: var(--muted); font-size: 0.9rem; }

.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.cart-table th, .cart-table td { text-align: left; padding: 0.6rem; border-bottom: 1px solid var(--border); }
.cart-table tfoot td { font-weight: 700; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; text-decoration: underline; padding: 0; }
.checkout-form label { display: block; margin-bottom: 0.75rem; }
.checkout-form input { display: block; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; width: 280px; margin-top: 0.25rem; }

/* hero + home category tiles */
.hero { padding: 2rem 0 1rem; }
.hero h1 { margin: 0 0 .25rem; }
.hero p { color: var(--muted); margin: 0; }
.category-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 1rem; margin-top: 1rem; }
.category-tile { display: flex; align-items: center; justify-content: center; min-height: 90px; text-align: center;
    border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--brand-dark); font-weight: 600; padding: 1rem; overflow: hidden; }
.category-tile:hover { border-color: var(--brand); background: #ecf7f0; }
/* image tiles: photo on top, label bar below */
.category-tile.has-img { flex-direction: column; align-items: stretch; padding: 0; min-height: 0; }
.category-tile.has-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.category-tile.has-img .tile-label { padding: .6rem 1rem; }
.category-tile.has-img:hover { background: #ecf7f0; }

/* group switcher (Show Options / Switch Color / swatches) */
.switcher { margin: 1rem 0; }
.switcher-label { font-weight: 600; margin-right: .5rem; }
.switcher ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: .5rem 0 0; }
.switcher li a { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border: 1px solid var(--border);
    border-radius: 6px; text-decoration: none; color: var(--text); font-size: .9rem; }
.switcher li.current a { border-color: var(--brand); background: #ecf7f0; font-weight: 600; }
.switcher li a img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }

/* category layout: facet sidebar + results */
.category-hero { width: 100%; max-height: 280px; object-fit: cover; border-radius: 8px; }
.category-intro { color: var(--text); margin: .5rem 0 1.5rem; max-width: 70ch; }
.category-layout { display: grid; grid-template-columns: 230px 1fr; gap: 1.5rem; }
@media (max-width: 720px) { .category-layout { grid-template-columns: 1fr; } }
.facets .result-count { font-weight: 700; }
.facets > a { display: block; margin-bottom: 1rem; text-decoration: none; color: var(--brand); }
.facets .facet-on { font-weight: 700; }
.facet h3 { font-size: .95rem; margin: 1rem 0 .4rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.facet ul { list-style: none; padding: 0; margin: 0; }
.facet li a { display: flex; justify-content: space-between; padding: .2rem 0; text-decoration: none; color: var(--text); font-size: .9rem; }
.facet li.selected a { color: var(--brand); font-weight: 600; }
.facet .count { color: var(--muted); }
.results-toolbar { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; color: var(--muted); font-size: .9rem; }
.results-toolbar a { text-decoration: none; color: var(--brand); }
.results-toolbar .sort-on { font-weight: 700; text-decoration: underline; }
.empty { color: var(--muted); }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1.5rem; }
.pager a { text-decoration: none; color: var(--brand); }
.price s { color: var(--muted); font-weight: 400; margin-left: .4rem; }

/* ---- dropdown nav ---- */
.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.main-nav .nav-item { position: relative; }
.main-nav .nav-item > a, .main-nav .nav-cart { display: inline-block; padding: 0.5rem 0.9rem; text-decoration: none; color: var(--text); border-radius: 6px; }
.main-nav .nav-item > a:hover { background: #ecf7f0; color: var(--brand-dark); }
.main-nav .nav-dropdown {
    position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff;
    border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08);
    padding: 0.4rem; display: none; z-index: 50;
}
.main-nav .nav-item:hover .nav-dropdown, .main-nav .nav-item:focus-within .nav-dropdown { display: block; }
.main-nav .nav-dropdown a { display: block; padding: 0.45rem 0.7rem; text-decoration: none; color: var(--text); border-radius: 5px; font-size: 0.92rem; }
.main-nav .nav-dropdown a:hover { background: #ecf7f0; color: var(--brand-dark); }
.main-nav .nav-cart { font-weight: 600; }

/* ---- breadcrumb ---- */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ---- home market blocks ---- */
.market-block { margin: 1.5rem 0; }
.market-block h2 { margin: 0 0 0.5rem; }
.market-block h2 a { text-decoration: none; color: var(--brand-dark); }

/* ---- subcategory drill-down tiles ---- */
.subcategory-tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.subcategory-tile {
    display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--border);
    border-radius: 20px; text-decoration: none; color: var(--brand-dark); font-size: 0.9rem; background: #fff;
}
.subcategory-tile:hover { border-color: var(--brand); background: #ecf7f0; }
/* image variant: small card with thumbnail above the label */
.subcategory-tile.has-img {
    display: flex; flex-direction: column; align-items: stretch; width: 150px; padding: 0;
    border-radius: 8px; overflow: hidden; font-weight: 600;
}
.subcategory-tile.has-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.subcategory-tile.has-img .tile-label { padding: .45rem .7rem; text-align: center; }

/* ---- facet collapse / show-all (pure CSS, no JS) ---- */
.facet-extra { display: none; }
.facet-toggle:checked ~ ul .facet-extra { display: block; }
.facet-more { display: inline-block; margin-top: .35rem; color: var(--brand); cursor: pointer; font-size: .85rem; user-select: none; }
.facet-more:hover { text-decoration: underline; }
.facet-more .when-expanded { display: none; }
.facet-toggle:checked ~ .facet-more .when-collapsed { display: none; }
.facet-toggle:checked ~ .facet-more .when-expanded { display: inline; }

/* ---- product image gallery ---- */
#main-image { width: 100%; border-radius: 8px; }
.thumb-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.product-images .thumb { width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.product-images .thumb:hover { border-color: var(--brand); }

/* ---- popup switcher (Show Options / Switch Color) ---- */
.switcher-row { margin: 1rem 0; }
.switcher-btn { display: inline-block; padding: 0.6rem 1.2rem; background: var(--brand); color: #fff; border-radius: 6px; cursor: pointer; font-weight: 600; }
.switcher-btn:hover { background: var(--brand-dark); }
.modal-overlay { display: none; }
.modal-toggle:checked ~ .modal-overlay { display: flex; position: fixed; inset: 0; align-items: center; justify-content: center; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); cursor: pointer; }
.modal { position: relative; background: #fff; border-radius: 10px; max-width: 780px; width: 92%; max-height: 82vh; overflow: auto; padding: 1.25rem 1.5rem; z-index: 1; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 1rem; }
.modal-close { position: absolute; top: 0.5rem; right: 0.9rem; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; }
.switcher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem; }
.switcher-choice { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); font-size: 0.85rem; }
.switcher-choice:hover { border-color: var(--brand); }
.switcher-choice img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.switcher-choice.current { border-color: var(--brand); background: #ecf7f0; font-weight: 600; }

/* ---- stock indicator ---- */
.stock { font-size: 0.9rem; font-weight: 600; color: var(--brand-dark); }
.stock.low { color: #b45309; }
.stock.oos { color: #b91c1c; }

/* text-only switcher (non-color): tighter chips, no images */
.switcher-grid.text-only { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.switcher-grid.text-only .switcher-choice { padding: 0.6rem 0.5rem; }

/* ---- branding ---- */
.logo-img { max-height: 44px; width: auto; display: block; }
.home-banner { background-size: cover; background-position: center; border-radius: 10px; min-height: 280px; display: flex; align-items: center; padding: 2rem; margin-bottom: 1rem; }
.home-banner-text { background: rgba(255,255,255,0.85); padding: 1rem 1.5rem; border-radius: 8px; max-width: 520px; }
.home-banner-text h1 { margin: 0 0 0.25rem; }
.home-banner-text p { margin: 0; color: var(--text); }

/* ---- editorial comparison tables (category intro HTML) ---- */
.category-intro table.compare { border-collapse: collapse; margin: 1rem 0; width: 100%; max-width: 560px; }
.category-intro table.compare th, .category-intro table.compare td { border: 1px solid var(--border); padding: 0.5rem 0.7rem; text-align: left; font-size: 0.92rem; }
.category-intro table.compare thead th { background: #ecf7f0; }

/* ---- admin tile preview ---- */
.preview-tile { max-width: 200px; }
.admin-table .thumb-cell { width: 64px; }
.admin-table .thumb-cell img { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); display: block; }
.admin-table .thumb-cell .no-img { color: var(--muted); }

/* ---- inspiration / curated collections ---- */
.inspiration-title, .collection-title { text-align: center; }
.inspiration-lede { text-align: center; margin-top: -.25rem; }
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 2rem 2.5rem; margin: 1.5rem 0; }
.collection-card { display: flex; flex-direction: column; }
.collection-card h2, .collection-card h3 { text-align: center; font-weight: 600; margin: 0 0 .6rem; }
.collection-photo { display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 8px; border: 1px solid var(--border); background: #f3f4f6; }
.collection-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collection-photo.no-img { display: flex; align-items: center; justify-content: center; min-height: 320px; }
.shop-design-btn { align-self: center; margin-top: .9rem; background: var(--brand); color: #fff; padding: .55rem 1.6rem; border-radius: 6px; text-decoration: none; font-weight: 600; }
.shop-design-btn:hover { background: var(--brand-dark); }
.collection-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin-top: 1rem; }
@media (max-width: 820px) { .collection-layout { grid-template-columns: 1fr; } }
.collection-hero, .collection-gallery-img { width: 100%; border-radius: 8px; display: block; margin-bottom: 1rem; }
.collection-intro { color: var(--text); max-width: 60ch; }
.shop-look-title, .related-title { text-align: center; font-weight: 600; }
.related-title { margin-top: 2.5rem; }
.look-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.look-grid .product-card h3 { font-size: .9rem; margin: .4rem 0 .25rem; }
.related-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ---- customer auth ---- */
.auth-card { max-width: 420px; margin: 2rem auto; }
.auth-form label { display: block; margin-bottom: .8rem; font-weight: 600; font-size: .9rem; }
.auth-form input[type=email], .auth-form input[type=password], .auth-form input:not([type]) {
    display: block; width: 100%; padding: .5rem; margin-top: .25rem; border: 1px solid var(--border); border-radius: 6px; font-weight: 400; }
.auth-form .chk { font-weight: 400; }
.auth-form button { background: var(--brand); color: #fff; border: none; border-radius: 6px; padding: .6rem 1.6rem; cursor: pointer; font-size: 1rem; }
ul.err { color: #b91c1c; }
.nav-account { padding: .5rem .9rem; text-decoration: none; color: var(--text); border-radius: 6px; }
.nav-account:hover { background: #ecf7f0; color: var(--brand-dark); }
.account-links { line-height: 1.9; }

/* ---- customer account portal ---- */
.account-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 1rem 0; }
.account-card { display: block; padding: 1.25rem; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); }
.account-card:hover { border-color: var(--brand); }
.account-card h2 { margin: 0 0 .35rem; font-size: 1.1rem; }
.signout-row { margin-top: 1.5rem; }
.btn-primary { display: inline-block; background: var(--brand); color: #fff; padding: .5rem 1.2rem; border-radius: 6px; text-decoration: none; font-weight: 600; }
.btn-primary:hover { background: var(--brand-dark); }
.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.address-card { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.address-tags { margin-bottom: .5rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.tag { background: #ecf7f0; color: var(--brand-dark); border-radius: 12px; padding: .1rem .6rem; font-size: .75rem; font-weight: 600; }
.tag.default { background: var(--brand); color: #fff; }
.address-actions { display: flex; gap: .75rem; align-items: center; margin-top: .5rem; }
.address-form .field-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.address-form select { display: block; width: 100%; padding: .5rem; margin-top: .25rem; border: 1px solid var(--border); border-radius: 6px; }
.acct-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.acct-table th, .acct-table td { text-align: left; padding: .55rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.acct-table tfoot td { border-bottom: none; }
.acct-table .r { text-align: right; color: var(--muted); }
.card-list { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.saved-card { display: flex; align-items: center; gap: 1rem; border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; }
.card-face { font-weight: 600; }
.tracking-box { border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; margin: 1rem 0; background: #f8fbf9; }
.tracking-box h2 { font-size: 1rem; margin: 0 0 .4rem; }
.addr-row { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 1rem; }
