/*
Theme Name: JLG Luxury
Theme URI: https://jillsluxurygoods.com
Author: Jill's Luxury Goods
Description: Mobile-first WooCommerce theme for Jill's Luxury Goods, reusing the site's dark/gold brand system.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: jlg-luxury
*/

:root {
    --bg-body: #080603;
    --bg-container: #14100b;
    --bg-card: #1c1710;
    --text-main: #f4f4f4;
    --text-muted: #c2b5a5;
    --accent-color: #f7c20c;
    --accent-dark: #af6d00;
    --border-color: #332a1e;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Lato', sans-serif;
    --tap-target: 44px;

    /* Radius scale - soft, editorial rounding rather than bubbly/full-round,
       except where a true pill shape is called for (filter tags, badges). */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --transition-fast: 150ms ease;
    --transition-base: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    font-weight: 300;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* Base form controls - overrides browser-default chrome (the outdated-
   looking native select/input styling) so every WooCommerce form element
   (sorting dropdown, quantity, coupon, checkout fields, account forms)
   matches the rest of the design language, not just the ones with a
   custom template. */
select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    min-height: var(--tap-target);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23c2b5a5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

select:hover,
input:hover,
textarea:hover {
    border-color: var(--accent-dark);
}

select:focus,
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(247, 194, 12, 0.15);
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Site header - sticky, mobile-first, subtle glass effect */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(20, 16, 11, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
}

.site-header .site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    font-family: var(--font-serif);
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: 1px;
    /* Logo + text must stay on one line at any width - the logo shrinks
       first (clamp, scales with viewport), then the text truncates with
       an ellipsis in the extremely unlikely event both are still too
       wide together (e.g. a very narrow foldable-phone viewport). */
    white-space: nowrap;
}

.site-logo-mark {
    height: clamp(40px, 14vw, 200px);
    width: auto;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
}

.site-logo-text {
    overflow: visible;
    text-overflow: ellipsis;
    line-height: 1.3;
    /* Mobile: 10% larger than the previous clamp(0.9rem, 4vw, 1.3rem). */
    font-size: clamp(0.99rem, 4.4vw, 1.43rem);
}

/* Desktop only - the clamp above scales the logo up to 200px tall at wide
   viewports, which reads oversized in a header; fixed to a normal header
   logo size instead, with the text height-matched to it exactly. */
@media (min-width: 640px) {
    .site-logo-mark {
        height: 48px;
    }

    .site-logo-text {
        font-size: 48px;
        line-height: 1;
    }
}

/* Phone landscape: the clamp()s above are keyed off viewport WIDTH, which
   is much larger in landscape than portrait, scaling the logo/text toward
   their max sizes even though the header's available HEIGHT is actually
   smaller - that mismatch was clipping the ascender/descender on letters
   like "J" and "y". max-height (not just orientation) keeps this scoped to
   short phone viewports, not landscape tablets/laptops. */
@media (orientation: landscape) and (max-height: 500px) {
    .site-logo-mark {
        height: 36px;
    }

    .site-logo-text {
        font-size: 1.05rem;
        line-height: 1.3;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--tap-target);
    height: var(--tap-target);
    color: var(--text-main);
    text-decoration: none;
    position: relative;
    border-radius: var(--radius-pill);
    transition: background-color var(--transition-fast);
    /* The search toggle reuses this class on a <button> - buttons get
       native OS border/background by default (the "circle artifact"),
       unlike <a> tags which don't, so reset explicitly for both. */
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.header-icon-link:hover {
    background-color: rgba(247, 194, 12, 0.1);
}

.cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent-color);
    color: #1a0f00;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: var(--radius-pill);
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Freeform product search - lives at the top of the Filter & Sort panel */
.shop-filter-search {
    margin-bottom: 22px;
}

.shop-filter-search form.woocommerce-product-search {
    display: flex;
    gap: 10px;
}

.shop-filter-search input[type="search"] {
    flex: 1;
}

.shop-filter-search button {
    width: auto;
    padding: 0 20px;
}

/* Shop filter bar - mobile-first sticky, collapsible, glass effect */
.shop-filter-bar {
    position: sticky;
    top: 72px;
    z-index: 90;
    background: rgba(20, 16, 11, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.shop-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 12px 18px;
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-family: var(--font-sans);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.85rem;
    min-height: var(--tap-target);
    cursor: pointer;
}

.shop-filter-chevron {
    flex-shrink: 0;
    transition: transform var(--transition-base);
}

.shop-filter-toggle[aria-expanded="true"] .shop-filter-chevron {
    transform: rotate(180deg);
}

.shop-filter-panel {
    display: none;
    border-top: 1px solid var(--border-color);
}

/* The filter bar itself is sticky (pinned near the top), so once it's
   opened and its content is taller than the remaining viewport, the
   overflow gets stuck off-screen with no way to reach it - the sticky
   bar doesn't scroll away, and dragging just scrolls the page behind it.
   Splitting the panel into a bounded, independently-scrolling options
   area plus a separate Filter/Reset bar that's a normal (non-scrolling)
   flex sibling - not part of the scroll area at all - guarantees the
   buttons are always the last thing at the bottom and nothing can ever
   scroll behind or past them. */
.shop-filter-panel.is-open {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
}

.shop-filter-options {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 18px 20px;
}

.shop-filter-group {
    margin-bottom: 22px;
}

.shop-filter-group h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 12px;
}

/* Grid (not flex-wrap) so every pill in a row is the same width and
   lines up cleanly - flex-wrap let each pill's own text/count length
   ("Chanel (12)" vs "YSL (3)") push things out of alignment. */
.shop-filter-group ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 480px) {
    .shop-filter-group ul {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Filter tags as proper pills: filled on hover/selected, generous padding */
.shop-filter-group li a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    text-decoration: none;
    text-align: center;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.shop-filter-group li a:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.shop-filter-group li.chosen a {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: #1a0f00;
    font-weight: 700;
}

.shop-filter-clear {
    display: inline-block;
    margin-top: 4px;
    color: var(--accent-color);
    font-size: 0.85rem;
    text-decoration: underline;
}

.color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

/* One consolidated "Filter" action applies everything (attribute pills +
   price range) at once - the price widget's own built-in submit button is
   redundant with that and hidden here. */
.price_slider_amount .button {
    display: none;
}

/* Price filter: style both possible states - the jQuery UI drag slider
   (if it initializes) and the plain min/max number inputs (the reliable
   fallback if it doesn't). Disabling WooCommerce's default stylesheet
   (see functions.php) stripped this widget's built-in look entirely. */
.price_slider_wrapper {
    padding: 6px 6px 0;
}

.price_slider.ui-slider {
    position: relative;
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-pill);
    margin: 16px 4px 22px;
}

.price_slider .ui-slider-range {
    position: absolute;
    height: 100%;
    background: var(--accent-color);
    border-radius: var(--radius-pill);
}

.price_slider .ui-slider-handle {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    transform: translateY(-50%);
    background: var(--accent-color);
    border: 2px solid var(--bg-body);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: grab;
    touch-action: none;
}

.price_slider .ui-slider-handle:active {
    cursor: grabbing;
}

.price_slider_amount {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.price_slider_amount .price_label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Plain min/max fallback - shown whenever the slider JS hasn't hidden
   them (i.e. always, unless the slider successfully initializes). */
#min_price,
#max_price {
    width: 90px;
    min-height: 40px;
    padding: 8px 12px;
}

/* A normal (non-scrolling) flex sibling of .shop-filter-options, not
   sticky and not part of the scroll area at all - always the last thing
   at the bottom of the panel, so nothing scrolling above it (pills,
   price slider handles) can ever render behind/past it. */
.shop-filter-apply-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px calc(22px + 8px);
    background-color: var(--bg-container);
    box-shadow: 0 -8px 16px -8px rgba(0, 0, 0, 0.4);
}

.shop-filter-reset {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.shop-filter-reset:hover {
    color: var(--accent-color);
}

.shop-filter-apply {
    flex: 1;
    background-color: var(--accent-color);
    color: #1a0f00;
}

/* Product grid. Mobile: always exactly 2 columns (auto-fill's minmax
   would drop to a single column below ~360px, since 150px x2 + gaps
   doesn't fit) - each column just shrinks to fit instead, capped at
   300px so it never grows larger than that on bigger phones. Desktop:
   auto-fill packs in as many 500px-max columns as fit, rather than
   stretching a fixed count to fill the whole width. */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 300px));
    justify-content: center;
    gap: 20px;
    padding: 20px 16px;
    list-style: none;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 500px));
        gap: 24px;
        padding: 24px 20px;
    }
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-dark);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.product-card .product-image {
    /* Portrait box (common for handbag/fashion photography) sized to hold
       the photo without cropping - object-fit: contain below shows the
       whole image at its real proportions, never stretched or cut off.
       Capped so images never render larger than that even in a wide grid
       column: 300x300 on mobile, 500x500 from 640px up (see media query
       below, matches the .products-grid column caps). */
    aspect-ratio: 3 / 4;
    max-width: 300px;
    max-height: 300px;
    overflow: hidden;
    background: #fff;
}

@media (min-width: 640px) {
    .product-card .product-image {
        max-width: 500px;
        max-height: 500px;
    }
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-base);
}

.product-card:hover .product-image img {
    transform: scale(1.04);
}

.product-card .product-info {
    padding: 14px 16px 18px;
}

.product-card .product-brand {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 6px;
}

.product-card .product-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-weight: 700;
    color: var(--text-main);
}

.product-card .product-price del {
    color: var(--text-muted);
    font-weight: 300;
    margin-right: 6px;
}

.products-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

/* Result count + sort-by row above the grid */
.woocommerce-result-count,
.woocommerce-ordering {
    padding: 0 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.woocommerce-result-count {
    padding-top: 18px;
}

.woocommerce-ordering {
    padding-top: 10px;
    padding-bottom: 4px;
}

/* Pagination as large, touch-friendly pills instead of tiny numbers */
.woocommerce-pagination {
    padding: 8px 16px 32px;
}

.woocommerce-pagination ul.page-numbers {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.woocommerce-pagination .page-numbers li {
    display: block;
}

.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.woocommerce-pagination .page-numbers a:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.woocommerce-pagination .page-numbers .current {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #1a0f00;
    font-weight: 700;
}

/* Single product */
.single-product-main {
    padding: 20px 16px;
    max-width: 700px;
    margin: 0 auto;
    display: block;
}

.single-product-gallery {
    margin-bottom: 24px;
}

/* Swipeable main image (pure CSS scroll-snap) plus a thumbnail strip
   (built by gallery.js) so it's always obvious how many photos there are
   and any one is reachable in a single tap - not just the next/previous
   one via blind swiping. Each photo sits in a bounded, consistent box so
   a very tall/narrow source photo never renders as an "extreme rectangle"
   the way an unconstrained full-width image would. */
.woocommerce-product-gallery__wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.woocommerce-product-gallery__image {
    flex: 0 0 100%;
    scroll-snap-align: start;
    aspect-ratio: 3 / 4;
    background: #fff;
    overflow: hidden;
}

.woocommerce-product-gallery__image a,
.woocommerce-product-gallery__image img {
    width: 100%;
    height: 100%;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gallery-thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

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

.single-product-gallery img,
.woocommerce-product-gallery img {
    object-fit: contain;
}

.single-product-title,
.summary.entry-summary .product_title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.single-product-price,
.summary.entry-summary .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-color);
    display: block;
    margin-bottom: 18px;
}

.summary.entry-summary {
    padding: 0 16px 16px;
}

.summary.entry-summary .cart {
    margin-bottom: 20px;
}

.single-product-attributes,
.product_meta,
.woocommerce-product-attributes {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    width: 100%;
}

.single-product-attributes table {
    width: 100%;
    border-collapse: collapse;
}

.single-product-attributes th,
.single-product-attributes td,
.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
    text-align: left;
    padding: 10px 12px 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.single-product-attributes th,
.woocommerce-product-attributes th {
    color: var(--text-muted);
    font-weight: 300;
    width: 40%;
}

.woocommerce-tabs {
    margin-top: 28px;
    padding: 0 16px;
}

.related.products {
    padding: 32px 16px 24px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
}

.related.products > h2 {
    font-family: var(--font-serif);
    margin-bottom: 14px;
}

/* Buttons - rounded, smooth fill transition on hover */
.btn-luxury,
.button,
button[type="submit"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-target);
    padding: 0 32px;
    background-color: transparent;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    color: var(--accent-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    transition: background-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

.btn-luxury:hover,
.button:hover,
button[type="submit"]:hover {
    background-color: var(--accent-color);
    color: #1a0f00;
    box-shadow: 0 6px 20px rgba(247, 194, 12, 0.25);
}

/* Footer */
.site-footer {
    margin-top: 60px;
    padding: 30px 16px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: #666;
    font-size: 0.8rem;
}
