/*
 * KilnCraft Theme Styles
 * CSS Custom Properties matching the original Tailwind design system
 *
 * @package KilnCraft
 */

/* ─── CSS Custom Properties (Design Tokens) ─── */
/* Self-hosted fonts (no external font CDN) */
@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Variable.ttf') format('truetype');
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Italic-Variable.ttf') format('truetype');
    font-style: italic;
    font-weight: 100 1000;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/PlayfairDisplay-Variable.ttf') format('truetype');
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
}

@font-face {
    font-family: 'Playfair Display';
    src: url('../fonts/PlayfairDisplay-Italic-Variable.ttf') format('truetype');
    font-style: italic;
    font-weight: 400 900;
    font-display: swap;
}

:root {
    /* Warm cream background */
    --background: #f5f0e8;
    --foreground: #3d2e1f;

    /* Card: slightly lighter cream */
    --card: #faf7f2;
    --card-foreground: #3d2e1f;

    --popover: #faf7f2;
    --popover-foreground: #3d2e1f;

    /* Primary: warm terracotta */
    --primary: #8b5e3c;
    --primary-foreground: #faf5f0;

    /* Secondary: muted sand */
    --secondary: #e8dfd2;
    --secondary-foreground: #4a3828;

    /* Muted: soft warm gray */
    --muted: #ebe3d6;
    --muted-foreground: #7a6b5d;

    /* Accent: olive earth */
    --accent: #6b7c4e;
    --accent-foreground: #faf5f0;

    --destructive: #a8371a;
    --destructive-foreground: #faf5f0;

    --border: #ddd4c5;
    --input: #e2d9cb;
    --ring: #8b5e3c;

    --radius: 0.5rem;
    --announcement-bar-height-desktop: 52px;
    --announcement-bar-height-mobile: 46px;
    --announcement-bar-current-height: var(--announcement-bar-height-desktop);
}

/* ─── Base Styles ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: var(--border);
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* ─── Typography ─── */
.font-sans {
    font-family: 'DM Sans', sans-serif;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

/* Remove WordPress default link underlines in theme areas */
a.no-underline {
    text-decoration: none !important;
}

/* ─── WordPress Core Overrides ─── */

/* Remove admin bar offset if needed */
body.admin-bar .sticky {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .sticky {
        top: 46px;
    }
}

/* WordPress navigation */
.wp-block-navigation a {
    text-decoration: none;
}

/* Fix WooCommerce default styles */
.woocommerce .products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .woocommerce .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .woocommerce .products {
        grid-template-columns: 1fr;
    }
}

/* ─── Pagination Styling ─── */
.page-numbers {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-numbers li {
    list-style: none;
}

.page-numbers a,
.page-numbers span {
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
    color: var(--foreground);
}

.page-numbers a:hover {
    background-color: var(--secondary);
}

.page-numbers .current {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

/* ─── Cart Drawer Animation ─── */
#cart-drawer {
    transition: transform 0.3s ease-in-out;
}

#cart-drawer.open {
    transform: translateX(0) !important;
}

#cart-overlay {
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

#cart-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* ─── Language Dropdown ─── */
#lang-dropdown {
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Mobile Menu ─── */
#mobile-menu {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Aspect Ratio Helpers ─── */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.aspect-\[4\/3\] {
    aspect-ratio: 4 / 3;
}

.aspect-\[4\/5\] {
    aspect-ratio: 4 / 5;
}

/* ─── WooCommerce General Overrides ─── */

/* Make WooCommerce defaults blend with our theme  */
.woocommerce,
.woocommerce-page {
    font-family: 'DM Sans', sans-serif;
    color: var(--foreground);
}

/* WooCommerce notices */
.woocommerce-message,
.woocommerce-info {
    border-top-color: var(--primary) !important;
    background-color: var(--secondary) !important;
    color: var(--foreground) !important;
    border-radius: var(--radius);
    padding: 1rem 1.5rem !important;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.woocommerce-message::before,
.woocommerce-info::before {
    color: var(--primary) !important;
}

.woocommerce-error {
    border-top-color: var(--destructive) !important;
    background-color: #fef2f2 !important;
    border-radius: var(--radius);
    padding: 1rem 1.5rem !important;
    margin-bottom: 1.5rem;
}

.woocommerce-error li {
    font-size: 0.875rem;
}

/* ─── WooCommerce Checkout Page Styling ─── */

/* ── 1. Checkout page wrapper ── */
.woocommerce-checkout {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.woocommerce-checkout .entry-title,
.woocommerce-checkout h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.875rem;
    color: var(--foreground);
    text-align: center;
    margin-bottom: 2rem;
}

/* ── 2. Checkout step indicator ── */
/*
 * All rules are scoped under .kc-checkout-steps (specificity 0-2-0 minimum),
 * which beats WooCommerce general.css rules like .woocommerce ol (0-1-1).
 * Combined with theme.css loading after woocommerce-general (via CSS dependency),
 * these rules are guaranteed to win by both specificity AND cascade position.
 */
.kc-checkout-steps {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.kc-checkout-steps .kc-checkout-steps__list {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.kc-checkout-steps .kc-checkout-step {
    list-style: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.kc-checkout-steps .kc-checkout-step__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    color: inherit;
}

.kc-checkout-steps a.kc-checkout-step__inner:hover .kc-checkout-step__bubble {
    background-color: var(--secondary);
}

.kc-checkout-steps .kc-checkout-step__bubble {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid var(--border);
    background-color: var(--background);
    color: var(--muted-foreground);
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    box-sizing: content-box;
}

.kc-checkout-steps .kc-checkout-step__bubble svg {
    width: 0.875rem;
    height: 0.875rem;
    display: block;
}

.kc-checkout-steps .kc-checkout-step__label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.kc-checkout-steps .kc-checkout-step__line {
    flex: 1;
    min-width: 2.5rem;
    max-width: 4.5rem;
    height: 1.5px;
    background-color: var(--border);
    margin: 0 0.5rem;
    margin-bottom: 1.25rem;
    list-style: none;
    flex-shrink: 1;
    display: block;
}

.kc-checkout-steps .kc-checkout-step--done .kc-checkout-step__bubble {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

.kc-checkout-steps .kc-checkout-step--done .kc-checkout-step__label {
    color: var(--primary);
}

.kc-checkout-steps .kc-checkout-step--active .kc-checkout-step__bubble {
    background-color: var(--foreground);
    border-color: var(--foreground);
    color: var(--background);
}

.kc-checkout-steps .kc-checkout-step--active .kc-checkout-step__label {
    color: var(--foreground);
    font-weight: 700;
}

/* ── 3. Two-column checkout grid ── */
.kc-checkout-layout {
    display: block;
    max-width: 100%;
}

.kc-checkout-left,
.kc-checkout-right {
    min-width: 0;
}

.kc-checkout-right {
    margin-top: 1.75rem;
}

.kc-checkout-right__sticky {
    /* no sticky — full linear flow */
}

/* ── 4. Section cards ── */
.kc-section-card {
    background-color: var(--card);
    border-radius: calc(var(--radius) * 1.5);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(61, 46, 31, 0.06), 0 1px 6px rgba(61, 46, 31, 0.04);
}

.kc-checkout-left .kc-section-card + .kc-section-card {
    margin-top: 1.5rem;
}

.kc-section-card__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background-color: rgba(245, 240, 232, 0.5);
}

.kc-section-card__icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--primary);
    flex-shrink: 0;
}

.kc-section-card__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--foreground);
    margin: 0;
    padding: 0;
    border: none !important;
}

.kc-section-card__body {
    padding: 1.5rem;
}

.kc-section-card--summary {
    padding: 0;
}

/* ── Visually hidden utility ── */
.kc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── 5. Mobile summary toggle ── */
/* Summary toggle: hidden — layout is now single column */
.kc-summary-toggle {
    display: none !important;
}

/* Summary panel: always visible */
.kc-summary-panel {
    display: block !important;
    border-radius: calc(var(--radius) * 1.5) !important;
}

.kc-summary-panel.is-open,
.kc-summary-panel.is-desktop {
    display: block !important;
}

/* ── 6. Section heading overrides ── */
/* WooCommerce generates h3 inside billing/shipping – hidden, replaced by kc-section-card__title */
.kc-section-card__body .woocommerce-billing-fields h3,
.kc-section-card__body .woocommerce-shipping-fields > h3,
.kc-section-card__body .woocommerce-additional-fields h3,
.kc-section-card__body > .woocommerce-billing-fields > h3,
#order_review_heading {
    display: none !important;
}

.woocommerce-checkout h3#ship-to-different-address-checkbox {
    font-size: 0.875rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    border-bottom: none !important;
    padding-bottom: 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Ship-to-different-address toggle ── */
.kc-section-card--ship-toggle .kc-section-card__body {
    padding: 0 1.5rem 1.25rem;
}

.kc-ship-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--foreground, #2d2926);
    user-select: none;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border, #e8e2db);
    background: var(--muted, #f7f3ef);
    transition: border-color 0.2s, background-color 0.2s;
}

.kc-ship-toggle:hover {
    border-color: #6b4c3b;
}

.kc-ship-toggle__input {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: #6b4c3b;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

/* ── 7. Form field grid within cards ── */
.kc-section-card__body .woocommerce-billing-fields__field-wrapper,
.kc-section-card__body .woocommerce-shipping-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
}

.kc-section-card__body .form-row-wide {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .kc-section-card__body .woocommerce-billing-fields__field-wrapper,
    .kc-section-card__body .woocommerce-shipping-fields__field-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Label styling */
.woocommerce-checkout .woocommerce-billing-fields label,
.woocommerce-checkout .woocommerce-shipping-fields label,
.woocommerce-checkout .woocommerce-additional-fields label,
.woocommerce-checkout label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted-foreground);
    margin-bottom: 0.375rem;
    display: block;
}

.woocommerce-checkout label .required {
    color: var(--destructive);
    text-decoration: none;
    border: none;
}

/* All form inputs */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="number"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout input[type="url"],
.woocommerce-checkout input[type="search"],
.woocommerce-checkout textarea,
.woocommerce-checkout select,
.woocommerce-checkout .select2-container .select2-selection--single,
.woocommerce-checkout .input-text {
    border: 1.5px solid var(--input) !important;
    border-radius: var(--radius) !important;
    background-color: var(--background) !important;
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
    font-family: 'DM Sans', sans-serif !important;
    color: var(--foreground) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.5 !important;
    height: auto !important;
}

.woocommerce-checkout input[type="text"]:focus,
.woocommerce-checkout input[type="email"]:focus,
.woocommerce-checkout input[type="tel"]:focus,
.woocommerce-checkout input[type="number"]:focus,
.woocommerce-checkout input[type="password"]:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout .input-text:focus {
    outline: none !important;
    border-color: var(--ring) !important;
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.15) !important;
}

.woocommerce-checkout input::placeholder,
.woocommerce-checkout textarea::placeholder {
    color: var(--muted-foreground);
    opacity: 0.65;
}

/* Select2 */
.woocommerce-checkout .select2-container .select2-selection--single {
    height: auto !important;
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
}

.woocommerce-checkout .select2-container .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.5 !important;
    color: var(--foreground) !important;
    font-size: 0.875rem !important;
}

.woocommerce-checkout .select2-container .select2-selection__arrow {
    height: 100% !important;
    right: 0.5rem !important;
}

.select2-dropdown {
    border: 1.5px solid var(--input) !important;
    border-radius: var(--radius) !important;
    background-color: var(--card) !important;
    box-shadow: 0 4px 16px rgba(61, 46, 31, 0.12) !important;
}

.select2-results__option {
    padding: 0.5rem 0.875rem !important;
    font-size: 0.875rem !important;
    color: var(--foreground) !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary) !important;
    color: var(--primary-foreground) !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--input) !important;
    border-radius: var(--radius) !important;
    padding: 0.5rem 0.875rem !important;
    font-size: 0.875rem !important;
}

/* Form row spacing */
.woocommerce-checkout .form-row {
    margin-bottom: 1.125rem;
    padding: 0 !important;
}

/* Float-based first/last form rows (used in coupon, login, payment boxes) */
.woocommerce-checkout .form-row-first,
.woocommerce-checkout .form-row-last {
    width: 48% !important;
    display: inline-block;
    vertical-align: top;
}

.woocommerce-checkout .form-row-first {
    float: left !important;
    margin-right: 2% !important;
}

.woocommerce-checkout .form-row-last {
    float: right !important;
    margin-left: 2% !important;
}

/* Override floats inside grid-based section card bodies (must come after float rules) */
.kc-section-card__body .form-row-first,
.kc-section-card__body .form-row-last {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    display: block !important;
}

@media (max-width: 480px) {
    .woocommerce-checkout .form-row-first,
    .woocommerce-checkout .form-row-last {
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* Clearfix */
.woocommerce-checkout .form-row::after {
    content: '';
    display: table;
    clear: both;
}

/* Textarea */
.woocommerce-checkout textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkbox */
.woocommerce-checkout input[type="checkbox"] {
    width: 1.0625rem !important;
    height: 1.0625rem !important;
    accent-color: var(--primary);
    margin-right: 0.5rem;
    vertical-align: middle;
    cursor: pointer;
}

/* ── 8. Order review table ── */
#order_review,
.woocommerce-checkout-review-order {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* wrapper div — the AJAX fragment target */
.woocommerce-checkout-review-order-table {
    width: 100%;
    margin: 0;
    display: block;
}

/* inner tables */
.kc-cart-items-table,
.kc-order-totals-table,
#order_review table.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.kc-cart-items-table thead {
    display: none;
}

.kc-cart-items-table tbody tr.cart_item td {
    padding: 0.875rem 1.25rem !important;
    border-bottom: 1px solid var(--border) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
    vertical-align: middle;
}

.kc-cart-items-table tbody tr.cart_item td.product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--foreground);
    width: 100%;
}

/* Product item row flex layout inside td */
.kc-item-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    min-width: 0;
}

.kc-item-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
}

.kc-item-thumb {
    width: 2.25rem !important;
    height: 2.25rem !important;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
    border: 1px solid var(--border);
}

.kc-item-qty {
    position: absolute;
    top: -0.375rem;
    right: -0.375rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: var(--foreground);
    color: var(--background);
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: 'DM Sans', sans-serif;
}

.kc-item-details {
    flex: 1;
    min-width: 0;
}

.kc-item-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.kc-item-details .variation {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    max-width: 100%;
}

.kc-item-details .variation dt,
.kc-item-details .variation dd,
.kc-item-details .variation dd p {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.kc-item-price {
    flex-shrink: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--foreground);
    white-space: nowrap;
    margin-inline-start: 0;
    justify-self: end;
    min-width: max-content;
}

/* ── Order totals table (separate from cart items) ── */
.kc-order-totals-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    margin-top: 0.25rem;
}

.kc-order-totals-table tr th,
.kc-order-totals-table tr td {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--border);
    background: transparent;
    vertical-align: middle;
}

.kc-order-totals-table tr th {
    /* label column: shrink to content */
    white-space: nowrap;
    width: 1px;
    font-weight: 500;
    color: var(--muted-foreground);
    text-align: start;
    padding-inline-end: 1.5rem;
}

.kc-order-totals-table tr td {
    /* value column: fills remaining space, value flush to end */
    text-align: end;
    font-weight: 500;
    color: var(--muted-foreground);
}

.kc-order-totals-table tr.cart-discount td,
.kc-coupon-amount {
    color: var(--accent) !important;
}

.kc-order-totals-table tr.order-total th,
.kc-order-totals-table tr.order-total td {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 700;
    border-bottom: none;
    color: var(--foreground);
}

/* hide any stray tfoot in the cart items table */
.kc-cart-items-table tfoot { display: none; }

/* Order review tfoot — legacy alias (unused, kept for plugin hooks) */
/* Shipping method list inside review table */
#shipping_method.woocommerce-shipping-methods {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    align-items: flex-start;
    direction: inherit;
}

#shipping_method.woocommerce-shipping-methods li {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    justify-content: flex-start;
    text-align: start;
    direction: inherit;
}

html[dir="rtl"] #shipping_method.woocommerce-shipping-methods,
html[dir="rtl"] #shipping_method.woocommerce-shipping-methods li {
    direction: rtl;
}

html[dir="ltr"] #shipping_method.woocommerce-shipping-methods,
html[dir="ltr"] #shipping_method.woocommerce-shipping-methods li {
    direction: ltr;
}

#shipping_method.woocommerce-shipping-methods li input[type="radio"] {
    width: 0.875rem !important;
    height: 0.875rem !important;
    margin: 0 !important;
    accent-color: var(--primary);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    #shipping_method.woocommerce-shipping-methods {
        align-items: stretch;
    }

    #shipping_method.woocommerce-shipping-methods li {
        white-space: normal;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .kc-order-totals-table tr th {
        white-space: normal;
        width: auto;
        padding-inline-end: 0.875rem;
    }
}

/* ── Shipping handmade notice ── */
.kc-shipping-notice {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    background-color: var(--muted);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.kc-shipping-notice p {
    margin: 0 0 0.5rem;
}

.kc-shipping-notice p:last-child {
    margin-bottom: 0;
}

.kc-shipping-notice a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── 9. Payment section ── */
#payment,
.woocommerce-checkout-payment {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
    border-top: 1.5px solid var(--border);
}

.kc-payment-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--foreground);
    border-bottom: 1px solid var(--border);
}

.kc-payment-header svg {
    width: 1rem;
    height: 1rem;
    color: var(--primary);
    flex-shrink: 0;
}

.kc-payment-methods {
    list-style: none !important;
    padding: 0.25rem 1.25rem !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--border);
}

.kc-payment-method {
    border-bottom: 1px solid var(--border);
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.kc-payment-method:last-child {
    border-bottom: none;
}

.kc-payment-method--empty {
    padding: 0.875rem 0 !important;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.kc-payment-method__label {
    display: flex !important;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 0;
    cursor: pointer;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    color: var(--foreground) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.kc-payment-method__input {
    width: 1.125rem !important;
    height: 1.125rem !important;
    accent-color: var(--primary);
    margin: 0 !important;
    flex-shrink: 0;
    cursor: pointer;
}

.kc-payment-method__name {
    flex: 1;
    font-size: 0.9375rem;
}

.kc-payment-method__icons {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.kc-payment-method__icons img {
    max-height: 22px;
    vertical-align: middle;
}

/* Payment gateway description / fields box */
.kc-payment-box {
    background-color: var(--background) !important;
    border-radius: var(--radius);
    padding: 0.875rem 1rem !important;
    margin-bottom: 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--muted-foreground) !important;
    border: 1px solid var(--border);
}

.kc-payment-box::before,
#payment .payment_box::before {
    display: none !important;
}

#payment .payment_box,
.woocommerce-checkout-payment .payment_box {
    background-color: var(--background) !important;
    border-radius: var(--radius);
    padding: 0.875rem 1rem !important;
    margin-top: 0.5rem;
    margin-bottom: 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--muted-foreground) !important;
    border: 1px solid var(--border);
}

/* Inputs inside payment gateways */
#payment .payment_box input[type="text"],
#payment .payment_box input[type="number"],
#payment .payment_box input[type="tel"],
#payment .payment_box input[type="password"],
#payment .payment_box select,
#payment .payment_box .input-text,
.kc-payment-box input,
.kc-payment-box select {
    border: 1.5px solid var(--input) !important;
    border-radius: var(--radius) !important;
    background-color: white !important;
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
    font-family: 'DM Sans', sans-serif !important;
    color: var(--foreground) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    line-height: 1.5 !important;
    margin-top: 0.25rem;
}

#payment .payment_box input:focus,
#payment .payment_box select:focus,
.kc-payment-box input:focus,
.kc-payment-box select:focus {
    outline: none !important;
    border-color: var(--ring) !important;
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.15) !important;
}

#payment .payment_box label,
.kc-payment-box label {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--muted-foreground) !important;
    margin-bottom: 0.25rem;
    display: block;
}

#payment .payment_box p {
    margin-bottom: 0.75rem;
}

#payment .payment_box fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

#payment .payment_box .form-row-first,
#payment .payment_box .form-row-last {
    width: 48% !important;
}

#payment .payment_box .form-row-wide {
    width: 100% !important;
}

.woocommerce-checkout .wc-credit-card-form-card-number,
.woocommerce-checkout .wc-credit-card-form-card-expiry,
.woocommerce-checkout .wc-credit-card-form-card-cvc {
    border: 1.5px solid var(--input) !important;
    border-radius: var(--radius) !important;
    background-color: white !important;
    padding: 0.625rem 0.875rem !important;
    font-size: 0.875rem !important;
    height: auto !important;
    min-height: 42px;
}

/* ── 10. Place Order section ── */
.kc-place-order {
    padding: 1.125rem 1.25rem !important;
    margin: 0 !important;
    width: 100% !important;
}

.woocommerce-terms-and-conditions-wrapper {
    margin-bottom: 1.125rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.woocommerce-terms-and-conditions-wrapper a {
    color: var(--primary);
    text-decoration: underline;
}

.woocommerce-terms-and-conditions-wrapper label {
    font-size: 0.8125rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: var(--foreground) !important;
    display: inline !important;
    font-weight: 400 !important;
    margin-bottom: 0 !important;
}

.woocommerce-privacy-policy-text p {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-bottom: 0.625rem;
}

/* Place Order button */
#payment #place_order,
.woocommerce-checkout #place_order,
.woocommerce #place_order,
.kc-place-order__btn {
    background-color: var(--primary) !important;
    color: var(--primary-foreground) !important;
    border-radius: var(--radius) !important;
    padding: 1rem 2rem !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    font-family: 'DM Sans', sans-serif !important;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s !important;
    border: none !important;
    cursor: pointer;
    width: 100%;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.5;
    display: block;
    text-align: center;
}

#payment #place_order:hover,
.woocommerce-checkout #place_order:hover {
    background-color: #7a5234 !important;
}

#payment #place_order:active {
    transform: scale(0.99);
}

#payment #place_order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Secure checkout badge */
.kc-secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 0.875rem !important;
    margin-bottom: 0 !important;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.kc-secure-badge svg {
    width: 0.875rem;
    height: 0.875rem;
    color: var(--accent);
    flex-shrink: 0;
}

/* Other checkout buttons */
.woocommerce-checkout .button,
.woocommerce-checkout button[type="submit"]:not(#place_order),
.woocommerce-checkout .woocommerce-Button {
    background-color: var(--primary) !important;
    color: var(--primary-foreground) !important;
    border-radius: var(--radius) !important;
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    font-family: 'DM Sans', sans-serif !important;
    transition: background-color 0.2s !important;
    border: none !important;
    cursor: pointer;
    line-height: 1.5;
}

.woocommerce-checkout .button:hover {
    opacity: 0.9;
}

/* Coupon form */
.woocommerce-checkout .checkout_coupon {
    background-color: var(--card);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    padding: 1.25rem !important;
    margin-bottom: 1.5rem;
}

.woocommerce-checkout .checkout_coupon .form-row-first {
    width: 70% !important;
}

.woocommerce-checkout .checkout_coupon .form-row-last {
    width: 25% !important;
}

/* Login form */
.woocommerce-checkout .woocommerce-form-login {
    background-color: var(--card);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius);
    padding: 1.25rem !important;
    margin-bottom: 1.5rem;
}

/* ─── WooCommerce Cart Page Styling ─── */

.woocommerce-cart .woocommerce {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.woocommerce table.shop_table {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    border-collapse: separate;
    overflow: hidden;
    width: 100%;
}

.woocommerce table.shop_table th {
    background-color: var(--secondary) !important;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-foreground);
    padding: 0.75rem 1rem !important;
    border: none !important;
}

.woocommerce table.shop_table td {
    padding: 1rem !important;
    border-top: 1px solid var(--border) !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    vertical-align: middle;
    font-size: 0.875rem;
    background-color: var(--card) !important;
}

.woocommerce table.shop_table .product-name a {
    color: var(--foreground);
    text-decoration: none;
    font-weight: 500;
}

.woocommerce table.shop_table .product-name a:hover {
    color: var(--primary);
}

.woocommerce table.shop_table .product-thumbnail img {
    border-radius: var(--radius);
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.woocommerce table.shop_table .product-remove a {
    color: var(--muted-foreground) !important;
    font-size: 1.25rem;
}

.woocommerce table.shop_table .product-remove a:hover {
    color: var(--destructive) !important;
}

/* Cart totals box */
.woocommerce .cart_totals {
    float: none !important;
    width: 100% !important;
    max-width: 480px;
    margin-left: auto;
}

.woocommerce .cart_totals h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.woocommerce .cart_totals .wc-proceed-to-checkout a.checkout-button {
    background-color: var(--primary) !important;
    color: var(--primary-foreground) !important;
    border-radius: var(--radius) !important;
    padding: 0.875rem 2rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    display: block;
    text-align: center;
}

/* ─── Announcement Bar ─── */
.announcement-bar {
    --ab-bg: #8b5e3c;
    --ab-text: #faf5f0;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    min-height: var(--announcement-bar-height-desktop);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--ab-bg), color-mix(in srgb, var(--ab-bg) 80%, #000));
    color: var(--ab-text);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    animation: announcement-slide-down 0.4s ease-out;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 30%,
        rgba(255, 255, 255, 0.08) 70%,
        transparent 100%
    );
    animation: announcement-shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

.announcement-bar__inner {
    width: 100%;
    max-width: none;
    min-height: var(--announcement-bar-height-desktop);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 3rem;
    gap: 0.5rem;
    position: relative;
}

.announcement-bar__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    text-align: center;
}

.announcement-bar__icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    animation: announcement-pulse 2s ease-in-out infinite;
}

.announcement-bar__text {
    letter-spacing: 0.025em;
}

.announcement-bar__link {
    color: var(--ab-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.announcement-bar__link:hover {
    opacity: 0.85;
}

.announcement-bar__close {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ab-text);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s, background 0.2s;
}

[dir="rtl"] .announcement-bar__close {
    right: auto;
    left: 0.75rem;
}

.announcement-bar__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

/* Dismissed state */
.announcement-bar--hidden {
    animation: announcement-slide-up 0.3s ease-in forwards;
}

/* Header offset when bar is visible */
body.has-announcement #site-header {
    top: var(--announcement-bar-current-height);
}

body.has-announcement {
    padding-top: var(--announcement-bar-current-height);
}

body.admin-bar.has-announcement #site-header {
    top: calc(32px + var(--announcement-bar-current-height));
}

body.admin-bar.has-announcement .announcement-bar {
    top: 32px;
}

/* Animations */
@keyframes announcement-slide-down {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes announcement-slide-up {
    from {
        transform: translateY(0);
        opacity: 1;
        max-height: 60px;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

@keyframes announcement-shimmer {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

@keyframes announcement-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Mobile adjustments */
@media (max-width: 640px) {
    :root {
        --announcement-bar-current-height: var(--announcement-bar-height-mobile);
    }

    .announcement-bar {
        min-height: var(--announcement-bar-height-mobile);
        font-size: 1rem;
    }

    .announcement-bar__inner {
        min-height: var(--announcement-bar-height-mobile);
        padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    }

    [dir="rtl"] .announcement-bar__inner {
        padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    }

    .announcement-bar__content {
        gap: 0.375rem;
    }

    .announcement-bar__close {
        right: 0.375rem;
    }

    [dir="rtl"] .announcement-bar__close {
        right: auto;
        left: 0.375rem;
    }

}

@media screen and (max-width: 782px) {
    body.admin-bar.has-announcement #site-header {
        top: calc(46px + var(--announcement-bar-current-height));
    }

    body.admin-bar.has-announcement .announcement-bar {
        top: 46px;
    }
}

.woocommerce .cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
    opacity: 0.9;
}

/* Quantity input in cart */
.woocommerce .quantity .qty {
    border: 1px solid var(--input) !important;
    border-radius: var(--radius) !important;
    padding: 0.375rem 0.5rem !important;
    width: 60px !important;
    text-align: center;
    font-size: 0.875rem;
}

/* ─── WooCommerce My Account Page ─── */

.woocommerce-account .woocommerce {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.woocommerce-account .woocommerce-MyAccount-navigation {
    float: none;
    width: 100%;
    margin-bottom: 2rem;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.woocommerce-account .woocommerce-MyAccount-content {
    float: none;
    width: 100%;
}

/* ─── WooCommerce Order Received / Thank You Page ─── */

.woocommerce-order-received .woocommerce {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    text-align: center;
}

.woocommerce-order-received .woocommerce-thankyou-order-received {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.woocommerce-order-received .woocommerce-order-overview {
    list-style: none;
    padding: 1.5rem;
    margin: 0 0 2rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.woocommerce-order-received .woocommerce-order-overview li {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.woocommerce-order-received .woocommerce-order-overview li strong {
    display: block;
    color: var(--foreground);
    font-size: 1rem;
    margin-top: 0.25rem;
}

/* ─── Scrollbar Styling ─── */
#cart-drawer .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
}

#cart-drawer .overflow-y-auto::-webkit-scrollbar-track {
    background: transparent;
}

#cart-drawer .overflow-y-auto::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 2px;
}

/* ─── RTL Support ─── */
[dir="rtl"] .flex-row-reverse {
    flex-direction: row-reverse;
}

[dir="rtl"] .text-start {
    text-align: right;
}

[dir="rtl"] .text-end {
    text-align: left;
}

/* ─── Print Styles ─── */
@media print {
    header,
    footer,
    #cart-drawer,
    #cart-overlay,
    .no-print {
        display: none !important;
    }
}

/* ─── Text Balance ─── */
.text-balance {
    text-wrap: balance;
}

/* ─── Selection Color ─── */
::selection {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

/* ═══════════════════════════════════════════════════════════════════
   ACCESSIBILITY WIDGET
   Compliant with WCAG 2.1 AA · ADA · Israeli Standard IS 5568
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Skip-to-content link ─── */
.a11y-skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    padding: 0.75rem 1.5rem;
    background: #000;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: top 0.2s;
    white-space: nowrap;
}
.a11y-skip-link:focus {
    top: 0;
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

/* ─── Reading guide ─── */
#a11y-reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 0, 0.35);
    pointer-events: none;
    z-index: 99990;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

/* ─── Widget container ─── */
.a11y-widget {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 99995;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
    direction: ltr;
}
.a11y-widget--rtl {
    left: auto;
    right: 1.5rem;
    direction: rtl;
}

/* Keep reCAPTCHA v3 badge default behavior, but lift it above the widget on desktop. */
@media (min-width: 769px) {
    .grecaptcha-badge {
        bottom: 92px !important;
    }
}

/* ─── Toggle button (the floating trigger) ─── */
.a11y-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: #f4efe6;
    color: #4a3726;
    border: 1px solid #dbcdbb;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(74, 55, 38, 0.16);
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}
.a11y-toggle:hover {
    background: #ece3d6;
    transform: translateY(-1px);
}
.a11y-toggle:focus-visible {
    outline: 3px solid #c79a5d;
    outline-offset: 2px;
}
.a11y-toggle__label {
    pointer-events: none;
}
.a11y-toggle__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ─── Panel ─── */
.a11y-panel {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    left: 0;
    width: 300px;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    color: #111;
    border: 1px solid #ddd;
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    overscroll-behavior: contain;
}
.a11y-widget--rtl .a11y-panel {
    left: auto;
    right: 0;
}
/* scrollbar inside panel */
.a11y-panel::-webkit-scrollbar { width: 6px; }
.a11y-panel::-webkit-scrollbar-track { background: transparent; }
.a11y-panel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* ─── Panel header ─── */
.a11y-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.a11y-panel__title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.a11y-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    cursor: pointer;
    color: #555;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.a11y-panel__close:hover { background: #f0f0f0; color: #111; }
.a11y-panel__close:focus-visible {
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

/* ─── Section ─── */
.a11y-section {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
}
.a11y-section__title {
    margin: 0 0 0.625rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
}

/* ─── Font size row ─── */
.a11y-row--font-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.a11y-font-counter {
    flex: 1;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
    min-width: 3.5rem;
}

/* ─── Feature grid ─── */
.a11y-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* ─── Generic button ─── */
.a11y-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: center;
    line-height: 1.2;
}
.a11y-btn:hover {
    background: #ececec;
    border-color: #bbb;
    color: #000;
}
.a11y-btn:focus-visible {
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
}

/* Icon-only button (font-size controls) */
.a11y-btn--icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    flex-shrink: 0;
    border-radius: 0.375rem;
}

/* Tile button (grid items) */
.a11y-btn--tile {
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.6rem 0.4rem;
    min-height: 4rem;
}

/* Active / pressed state */
.a11y-btn--active,
.a11y-btn[aria-pressed="true"] {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}
.a11y-btn--active:hover,
.a11y-btn[aria-pressed="true"]:hover {
    background: #16213e;
    border-color: #16213e;
}

/* ─── Reset button ─── */
.a11y-footer {
    padding: 0.75rem 1rem 0.5rem;
    display: flex;
    justify-content: center;
}
.a11y-btn--reset {
    gap: 0.4rem;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    background: #f0f0f0;
    color: #444;
    border: 1px solid #ddd;
    font-size: 0.8rem;
    width: 100%;
    justify-content: center;
}
.a11y-btn--reset:hover {
    background: #e5e5e5;
    color: #000;
}

/* ─── Accessibility statement ─── */
.a11y-statement {
    margin: 0;
    padding: 0.5rem 1rem 0.875rem;
    text-align: center;
    font-size: 0.7rem;
    color: #888;
}
.a11y-statement__link {
    color: #555;
    text-decoration: underline;
}
.a11y-statement__link:hover { color: #000; }
.a11y-statement__link:focus-visible {
    outline: 3px solid #ffbf00;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   ACCESSIBILITY MODE OVERRIDES  (applied via data-attributes on <html>)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── High contrast ─── */
[data-a11y-high-contrast] {
    filter: none !important;
    background-color: #000 !important;
    color: #fff !important;
}
[data-a11y-high-contrast] *:not(.a11y-widget):not(.a11y-widget *) {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}
[data-a11y-high-contrast] a,
[data-a11y-high-contrast] button {
    color: #ffff00 !important;
}
[data-a11y-high-contrast] img { filter: contrast(1.2) brightness(0.9); }

/* ─── Negative contrast ─── */
[data-a11y-negative-contrast] *:not(.a11y-widget):not(.a11y-widget *) {
    filter: invert(1) hue-rotate(180deg);
}
[data-a11y-negative-contrast] img,
[data-a11y-negative-contrast] video {
    filter: invert(1) hue-rotate(180deg);
}

/* ─── Grayscale ─── */
[data-a11y-grayscale] *:not(.a11y-widget):not(.a11y-widget *) {
    filter: grayscale(1) !important;
}

/* ─── Readable / dyslexia-friendly font ─── */
[data-a11y-readable-font],
[data-a11y-readable-font] * {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.15em !important;
    line-height: 1.75 !important;
}

/* ─── Underline links ─── */
[data-a11y-underline-links] a {
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

/* ─── Pause animations / transitions ─── */
[data-a11y-pause-animations] *,
[data-a11y-pause-animations] *::before,
[data-a11y-pause-animations] *::after {
    animation-play-state: paused !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/* ─── Large cursor ─── */
[data-a11y-big-cursor],
[data-a11y-big-cursor] * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l32 24-14 2-8 16L8 4z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 0 0, auto !important;
}

/* ─── Focus indicators (always visible, not just in high-contrast) ─── */
:focus-visible {
    outline: 3px solid #ffbf00 !important;
    outline-offset: 2px !important;
}

/* ─── Reduced-motion media query (honour OS preference) ─── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── Responsive: on very small screens, make panel full-width ─── */
@media (max-width: 360px) {
    .a11y-panel { width: calc(100vw - 2rem); }
    .a11y-widget { left: 1rem; bottom: 1rem; }
    .a11y-widget--rtl { right: 1rem; left: auto; }
}

@media (max-width: 768px) {
    .a11y-toggle {
        width: 52px;
        height: 52px;
        border-radius: 999px;
        padding: 0;
        justify-content: center;
        gap: 0;
    }
    .a11y-toggle__label {
        display: none;
    }
    .a11y-toggle__icon {
        width: 22px;
        height: 22px;
    }
}

/* ─── Limited Edition badge ─── */
.kc-limited-edition-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6rem;
    font-style: italic;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.6;
}
.kc-limited-edition-badge svg {
    width: 0.65rem;
    height: 0.65rem;
    flex-shrink: 0;
    stroke: #fff;
}

/* Product card add-to-cart action */
.kc-product-card__cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.75rem;
    margin-top: 0.875rem;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(139, 94, 60, 0.28);
    border-radius: var(--radius);
    background-color: var(--card);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(61, 46, 31, 0.08);
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.kc-product-card__cart-button svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.kc-product-card__cart-button:hover {
    color: var(--primary-foreground);
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(139, 94, 60, 0.18);
    transform: translateY(-1px);
}

.kc-product-card__cart-button:active {
    box-shadow: 0 1px 3px rgba(61, 46, 31, 0.08);
    transform: translateY(0);
}

.kc-product-card__cart-button:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 3px;
}
