/*
 * JD Uniforms — Launch polish (v1.0.0)
 *
 * Additive stylesheet that layers on top of style.css.
 * Covers: PDP rewrite, archive swatches, mobile CTA, a11y focus rings,
 *         trust row, embroidery section, sticky header, size guide button.
 */

/* ---------- Tokens ---------- */
:root {
    --jd-radius: 6px;
    --jd-shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
    --jd-shadow-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.06);
    --jd-shadow-lg: 0 10px 25px -5px rgba(15,23,42,.10), 0 8px 10px -6px rgba(15,23,42,.06);
}

/* ---------- A11y ---------- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
*:focus-visible {
    outline: 2px solid var(--jd-teal);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Sticky header on scroll ---------- */
.site-header {
    position: fixed; top: 30px; left: 0; right: 0;
    background: #fff;
    z-index: 1000;
    box-shadow: var(--jd-shadow-sm);
    transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: var(--jd-shadow-md); }

/* ---------- PDP Layout ---------- */
.jd-pdp .product_layout_wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
@media (max-width: 900px) {
    .jd-pdp .product_layout_wrapper { grid-template-columns: 1fr; gap: 24px; }
}

.jd-pdp-gallery .woocommerce-product-gallery {
    width: 100% !important;
    background: var(--jd-light);
    border-radius: var(--jd-radius);
    overflow: hidden;
}
.jd-pdp-gallery .woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    display: block;
}
.jd-pdp-gallery .flex-control-thumbs {
    display: flex; gap: 8px; padding: 12px; margin: 0; list-style: none;
    flex-wrap: wrap;
}
.jd-pdp-gallery .flex-control-thumbs li {
    width: 64px; height: 64px;
}
.jd-pdp-gallery .flex-control-thumbs img {
    width: 100%; height: 100%; object-fit: cover;
    border: 2px solid transparent; border-radius: 4px; cursor: pointer;
    transition: border-color .15s;
}
.jd-pdp-gallery .flex-control-thumbs img.flex-active,
.jd-pdp-gallery .flex-control-thumbs img:hover {
    border-color: var(--jd-teal);
}

/* Summary */
.jd-pdp-summary .product_title {
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    margin: 0 0 12px;
    line-height: 1.2;
}
.jd-price-row .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--jd-dark);
}
.jd-price-row del { color: var(--jd-slate); font-weight: 400; margin-right: 8px; }
.jd-price-row ins { text-decoration: none; }

.sezzle-promo {
    background: #f9fafb;
    border-left: 3px solid var(--jd-teal);
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--jd-slate);
    margin: 12px 0 20px;
    border-radius: 0 4px 4px 0;
}
.sezzle-logo { color: var(--jd-teal); font-weight: 700; }

.woocommerce-product-details__short-description {
    color: var(--jd-slate);
    line-height: 1.65;
    margin-bottom: 20px;
}
.product_meta_inline { font-size: 0.9rem; color: var(--jd-slate); margin-bottom: 16px; }

/* Option labels */
.jd-option-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--jd-dark);
}
.jd-option-value { font-weight: 400; color: var(--jd-slate); }

/* Color swatches */
.jd-color-selection,
.jd-size-selection,
.variations { margin-bottom: 24px; }
.product-color-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--jd-border);
    cursor: pointer;
    transition: all .15s;
    padding: 0;
}
.color-swatch-btn:hover { transform: scale(1.08); }
.color-swatch-btn.active {
    box-shadow: 0 0 0 2px var(--jd-teal);
    transform: scale(1.08);
}

/* Size swatches */
.size-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-btn {
    min-width: 48px;
    height: 44px;
    padding: 0 14px;
    background: #fff;
    border: 1.5px solid var(--jd-border);
    border-radius: var(--jd-radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--jd-dark);
    transition: all .15s;
}
.swatch-btn:hover { border-color: var(--jd-dark); }
.swatch-btn.active {
    background: var(--jd-dark);
    color: #fff;
    border-color: var(--jd-dark);
}

.jd-size-guide-btn {
    background: none;
    border: none;
    color: var(--jd-teal);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* Stock line */
.jd-stock-line { font-size: 0.9rem; margin: 8px 0 16px; }
.jd-stock-line .in-stock { color: #059669; font-weight: 600; }
.jd-stock-line .out-of-stock { color: #b91c1c; font-weight: 600; }

/* Quantity */
.jd-pdp .quantity,
.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--jd-border);
    border-radius: var(--jd-radius);
    overflow: hidden;
    margin-right: 12px;
}
.jd-pdp .qty-btn,
.quantity-selector .qty-btn {
    width: 44px; height: 44px;
    background: #fff; border: none;
    font-size: 1.25rem; font-weight: 600;
    cursor: pointer;
    color: var(--jd-dark);
}
.jd-pdp .qty-btn:hover { background: var(--jd-light); }
.jd-pdp .quantity input,
.quantity-selector input {
    width: 56px; height: 44px;
    text-align: center;
    border: none; border-left: 1.5px solid var(--jd-border);
    border-right: 1.5px solid var(--jd-border);
    font-weight: 600; font-size: 1rem;
    background: #fff;
    -moz-appearance: textfield;
}
.jd-pdp .quantity input::-webkit-outer-spin-button,
.jd-pdp .quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}

/* Embroidery */
.embroidery-section {
    border: 1px dashed var(--jd-border);
    border-radius: var(--jd-radius);
    padding: 14px 16px;
    margin: 20px 0;
    background: #fafbfc;
}
.embroidery-toggle {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; font-weight: 500;
}
.embroidery-toggle input { width: 18px; height: 18px; accent-color: var(--jd-teal); }
.embroidery-fields { margin-top: 14px; display: grid; gap: 12px; }
.embroidery-fields .form-row { display: grid; gap: 4px; }
.embroidery-fields label { font-size: 0.8rem; color: var(--jd-slate); font-weight: 600; }
.embroidery-fields input,
.embroidery-fields select {
    height: 38px; padding: 0 12px;
    border: 1px solid var(--jd-border);
    border-radius: 4px;
    font-size: 0.95rem;
    background: #fff;
}
.embroidery-note {
    font-size: 0.8rem; color: var(--jd-slate); margin: 4px 0 0;
}

/* Add-to-cart button */
.single_add_to_cart_button,
.jd-pdp .single_add_to_cart_button.button.alt {
    background: var(--jd-dark);
    color: #fff;
    padding: 14px 28px;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: var(--jd-radius);
    cursor: pointer;
    transition: background .15s;
    min-height: 48px;
    min-width: 200px;
}
.single_add_to_cart_button:hover { background: var(--jd-teal); }
.single_add_to_cart_button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Trust row */
.jd-trust-row {
    display: flex; flex-wrap: wrap; gap: 18px;
    padding: 18px 0;
    margin: 24px 0 0;
    border-top: 1px solid var(--jd-border);
    border-bottom: 1px solid var(--jd-border);
    font-size: 0.85rem;
    color: var(--jd-slate);
}
.jd-trust-row i { color: var(--jd-teal); margin-right: 6px; }

.product_meta_footer {
    margin-top: 18px; font-size: 0.85rem; color: var(--jd-slate);
}
.product_meta_footer a { color: var(--jd-teal); }
.product_meta_footer a:hover { text-decoration: underline; }

/* ---------- Sticky mobile CTA ---------- */
.jd-mobile-cta {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--jd-border);
    padding: 10px 16px;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}
.jd-mobile-cta-inner {
    display: flex; align-items: center; gap: 12px;
    max-width: 100%;
}
.jd-mobile-price { font-weight: 700; font-size: 1.1rem; flex: 1; }
.jd-mobile-add-btn {
    background: var(--jd-dark); color: #fff;
    border: none; border-radius: var(--jd-radius);
    padding: 12px 24px; font-weight: 700; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 0.5px;
    cursor: pointer; min-height: 44px;
}
@media (max-width: 768px) {
    .jd-pdp { padding-bottom: 80px; }
    .jd-mobile-cta { display: block; }
}

/* ---------- Archive cards ---------- */
.woocommerce ul.products li.product,
ul.products li.product {
    background: #fff;
    border: 1px solid transparent;
    border-radius: var(--jd-radius);
    padding: 12px;
    transition: all .2s;
    list-style: none;
}
.woocommerce ul.products li.product:hover,
ul.products li.product:hover {
    border-color: var(--jd-border);
    box-shadow: var(--jd-shadow-md);
    transform: translateY(-2px);
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--jd-dark);
    margin: 10px 0 4px;
    line-height: 1.3;
}
.woocommerce ul.products li.product .price {
    color: var(--jd-dark);
    font-weight: 700;
    font-size: 1.05rem;
}
.jd-color-swatches {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin: 8px 0;
}
.jd-color-swatches .swatch {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
}
.jd-color-swatches .swatch-more {
    font-size: 0.7rem;
    color: var(--jd-slate);
    font-weight: 600;
    align-self: center;
    margin-left: 2px;
}

/* ---------- Header touch targets ---------- */
.header-icon, .menu-toggle {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
}
