:root {
    --bg: #faf7f2;
    --surface: #ffffff;
    --text: #2b2420;
    --muted: #7a6f66;
    --border: #e8e0d6;
    --accent: #b5543c;
    --accent-rgb: 181, 84, 60;   /* same color as --accent, for rgba() glows */
    --accent-hover: #9a4430;
    --radius: 12px;
    --shadow: 0 2px 10px rgba(43, 36, 32, 0.08);
}

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

body {
    margin: 0;
    display: flex; flex-direction: column; min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: inherit; }

/* Blazor moves focus to the page heading after navigation (for screen readers); no visible ring. */
h1:focus { outline: none; }
img { display: block; max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1 0 auto; width: 100%; padding-top: 24px; padding-bottom: 48px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 10;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.brand { font-size: 1.25rem; font-weight: 700; text-decoration: none; white-space: nowrap; }

.header-links { display: flex; gap: 22px; }
.header-links a {
    color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 500; white-space: nowrap;
    padding: 4px 0; border-bottom: 2px solid transparent;
}
.header-links a:hover { color: var(--text); }
.header-links a.active { color: var(--text); border-bottom-color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.icon { display: block; flex: none; }

@media (max-width: 760px) {
    .header-inner { flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; padding-bottom: 6px; }
    .header-links { order: 3; width: 100%; gap: 18px; overflow-x: auto; }
    .header-actions { gap: 8px; }
}
@media (max-width: 420px) {
    .basket-label { display: none; }
}

.basket-btn {
    position: relative;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); font: inherit; cursor: pointer;
}
.basket-btn:hover { border-color: var(--accent); }
.badge {
    min-width: 22px; padding: 0 6px;
    border-radius: 999px;
    background: var(--accent); color: #fff;
    font-size: 0.8rem; font-weight: 600; text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border: none; border-radius: 8px;
    background: var(--accent); color: #fff;
    font: inherit; font-weight: 600; text-decoration: none;
    cursor: pointer;
}
.product-footer .btn { white-space: nowrap; padding: 8px 12px; }
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-small { padding: 4px 10px; font-size: 0.85rem; margin-left: 8px; }
.btn-block { width: 100%; }

.link-btn, .icon-btn {
    border: none; background: none; padding: 0;
    font: inherit; color: var(--muted); cursor: pointer;
}
.link-btn { font-size: 0.85rem; text-decoration: underline; }
.icon-btn { font-size: 1.2rem; padding: 4px 8px; }
.link-btn:hover, .icon-btn:hover { color: var(--text); }

.alert {
    padding: 12px 16px;
    border: 1px solid #e5b5a8; border-radius: 8px;
    background: #fbeae5;
}

/* ---------- Category bar & sort ---------- */
.category-bar {
    display: flex; gap: 8px;
    margin: 0 0 20px; padding: 4px 0 10px;
    overflow-x: auto;              /* scrolls sideways on phones instead of wrapping */
    scrollbar-width: thin;
    border-bottom: 1px solid var(--border);
}
.category-chip {
    flex: none;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 0.92rem; white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.category-chip:hover { border-color: var(--accent); }
.category-chip.active {
    background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.chip-count {
    min-width: 20px; padding: 0 6px; border-radius: 999px;
    background: #f1ebe3; color: var(--muted);
    font-size: 0.75rem; font-weight: 600; text-align: center;
}
.category-chip.active .chip-count { background: rgba(255, 255, 255, 0.25); color: #fff; }

.catalog-toolbar {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    margin-bottom: 18px;
}
.catalog-toolbar h1 { margin: 0; }
.result-count { margin: 2px 0 0; font-size: 0.9rem; }

.sort-control { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
.sort-control select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); color: var(--text); font: inherit;
    cursor: pointer;
}
.sort-control select:focus { outline: 2px solid rgba(181, 84, 60, 0.35); border-color: var(--accent); }

.product-grid.is-loading { opacity: 0.55; transition: opacity 0.15s ease; }

/* ---------- Creator link & showcase ---------- */
.creator-link { display: block; margin: -2px 0 8px; font-size: 0.85rem; color: var(--muted); }
.creator-link a { color: var(--accent); font-weight: 600; text-decoration: none; }
.creator-link a:hover { text-decoration: underline; }
.creator-link-large { margin: -4px 0 12px; font-size: 1rem; }

.creator-header {
    display: flex; align-items: center; gap: 20px;
    margin-bottom: 24px; padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.creator-avatar {
    flex: none;
    width: 76px; height: 76px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), #d98a5f);
    color: #fff; font-size: 2rem; font-weight: 700;
}
.creator-intro { min-width: 0; }
.creator-intro h1 { margin: 0; word-break: break-word; }
.creator-stats { margin: 2px 0 0; font-size: 0.9rem; }
.creator-bio { margin: 10px 0 0; max-width: 720px; white-space: pre-line; }
.toolbar-title { margin: 0; font-size: 1.3rem; }

@media (max-width: 560px) {
    .creator-header { flex-direction: column; align-items: flex-start; padding: 18px; }
    .creator-avatar { width: 60px; height: 60px; font-size: 1.6rem; }
}

/* ---------- Catalog grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.product-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(43, 36, 32, 0.12); }

.product-image {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1;
    background: #f1ebe3;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { font-size: 3.5rem; opacity: 0.6; }

/* Image frame follows the photo's orientation (set on the card by js/files.js). */
.product-card[data-orientation="landscape"] .product-image { aspect-ratio: 4 / 3; }
.product-card[data-orientation="portrait"] .product-image { aspect-ratio: 3 / 4; }

/* Description: only when the image leaves room (square / landscape). It takes at least 2 lines,
   then grows into whatever height the grid row gives the card (rows match the tallest card),
   so shorter-image cards fill their empty space with text. Longer text fades out at the bottom.
   Hidden until the orientation is known, so portrait cards never flash it. */
.product-desc {
    display: none;
    flex: 1 1 0;
    min-height: calc(2 * 1.45em);
    margin: 0 0 12px;
    font-size: 0.8rem; line-height: 1.45; color: var(--muted);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.45em), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 1.45em), transparent);
}
.product-card[data-orientation="square"] .product-desc,
.product-card[data-orientation="landscape"] .product-desc { display: block; }

.product-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.product-title { margin: 0 0 6px; font-size: 1.05rem; }
.product-title a { text-decoration: none; }
.product-title a:hover { color: var(--accent); }

.product-meta {
    display: grid; grid-template-columns: auto 1fr;
    gap: 2px 10px; margin: 0 0 12px;
    font-size: 0.9rem;
}
.product-meta dt { color: var(--muted); }
.product-meta dd { margin: 0; }

.product-footer {
    display: flex; flex-direction: column; align-items: stretch; gap: 10px;
    margin-top: auto;
}
/* Buy Now + Add to Basket: one row, equal width and height. */
.card-actions { display: flex; gap: 8px; }
.card-actions .btn {
    flex: 1 1 0; min-width: 0;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 8px; font-size: 0.88rem; line-height: 1.2; white-space: nowrap;
}
.price { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.price-large { font-size: 1.6rem; margin: 0 0 16px; color: var(--accent); }
.out-of-stock { color: var(--muted); font-size: 0.9rem; }

/* ---------- Product card: metrics row, heart toggle, favorite badge ---------- */

/* Relative positioning so the badge can sit on top of the card */
.product-card { position: relative; }

.favorite-badge {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    background: #fff8e1; color: #8a6200;
    border: 1px solid #f5d060;
    padding: 3px 9px; border-radius: 999px;
    font-size: 0.75rem; font-weight: 700;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.product-metrics-row {
    display: flex; align-items: center; gap: 8px;
    margin: 6px 0 10px;
}

.metric-pill {
    font-size: 0.78rem; color: var(--muted);
    white-space: nowrap;
}

.price-row { display: flex; align-items: center; gap: 6px; }

.heart-btn {
    margin-left: 0;
    background: none; border: none; padding: 0;
    font-size: 1.15rem; line-height: 1;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}
.heart-btn:hover { transform: scale(1.2); }
.heart-btn:active { transform: scale(0.9); }
.heart-btn.liked { animation: heart-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes heart-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ---------- Product details ---------- */
.back-link { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--text); }

.product-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
}
.details-info h1 { margin: 0 0 8px; }
.description { white-space: pre-line; }

.gallery-main {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1;
    background: #f1ebe3;
    border-radius: var(--radius); overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb {
    width: 64px; height: 64px; padding: 0;
    border: 2px solid transparent; border-radius: 8px;
    overflow: hidden; background: none; cursor: pointer;
}
.thumb.active { border-color: var(--accent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Product page: quantity + "Buy Now" / "Add to Basket" ---------- */
.purchase-box { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; max-width: 520px; }
.qty-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.qty-field input {
    width: 96px; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 12px;
    font: inherit; color: var(--text);
}

/* Desktop: side by side (flex-row gap-3). Mobile: stacked, full width (flex-col gap-2 w-full). */
.buy-actions { display: flex; flex-direction: row; gap: 12px; }
.buy-btn {
    flex: 1 1 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px;                 /* py-3 px-6 — identical height for both */
    border: none; border-radius: 12px;  /* rounded-xl */
    color: #fff; font: inherit; font-size: 1rem; font-weight: 600; line-height: 1.4;
    white-space: nowrap; cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.buy-btn:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.45); outline-offset: 2px; }
.buy-btn:active { transform: translateY(1px); }

/* Primary direct action: charcoal slate → black on hover */
.buy-btn-now { background: #678A65; }
.buy-btn-now:hover { background: #000; }

/* Secondary action: terracotta → deeper terracotta on hover */
.buy-btn-basket { background: #B8523A; }
.buy-btn-basket:hover { background: #A0452E; }

@media (max-width: 640px) {
    .purchase-box { max-width: none; }
    .buy-actions { flex-direction: column; gap: 8px; }
    .buy-btn { width: 100%; }
}

/* ---------- Toasts ---------- */
.toast-region {
    position: fixed; left: 50%; bottom: 24px; z-index: 50;
    transform: translateX(-50%);
    width: min(460px, calc(100% - 32px));
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: 12px;
    background: #1F2937; color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    animation: toast-in 0.2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.toast-icon {
    flex: none; width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #2f7d4f; font-size: 0.8rem; font-weight: 700;
}
.toast-message { flex: 1; min-width: 0; font-size: 0.92rem; }
.toast-action { color: #f4b9a6; font-weight: 700; text-decoration: none; white-space: nowrap; }
.toast-action:hover { text-decoration: underline; }
.toast-close { border: none; background: none; color: #9ca3af; font: inherit; cursor: pointer; padding: 0 2px; }
.toast-close:hover { color: #fff; }
.buy-now-note { padding: 8px 10px; border-radius: 8px; background: #f6efe8; }

.empty-state { text-align: center; padding: 48px 0; }

@media (max-width: 720px) {
    .product-details { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Basket drawer ---------- */
.drawer-backdrop {
    position: fixed; inset: 0; z-index: 20;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
    display: flex; flex-direction: column;
    width: min(400px, 100%);
    background: var(--surface);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    visibility: hidden;
}
.cart-drawer.open { transform: translateX(0); visibility: visible; }

.drawer-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.drawer-header h2 { margin: 0; font-size: 1.2rem; }
.drawer-empty { padding: 24px 20px; }

.cart-items { list-style: none; margin: 0; padding: 0 20px; overflow-y: auto; flex: 1; }
.cart-item {
    display: grid; grid-template-columns: 64px 1fr auto; gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.cart-thumb {
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: #f1ebe3; border-radius: 8px; overflow: hidden;
    font-size: 1.6rem;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-item-title { font-weight: 600; text-decoration: none; }
.cart-item-title:hover { color: var(--accent); }
.cart-line-total { font-weight: 600; white-space: nowrap; }

.qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-btn {
    width: 28px; height: 28px;
    border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); font: inherit; cursor: pointer;
}
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-value { min-width: 20px; text-align: center; }

.drawer-footer {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border);
}
.cart-total { display: flex; justify-content: space-between; width: 100%; font-size: 1.05rem; }

/* ---------- Blazor error banner ---------- */
#blazor-error-ui {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    padding: 12px 20px;
    background: #fff3cd; box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
}
#blazor-error-ui .reload { margin-left: 8px; }

/* ---------- Announcement bar ---------- */
.announcement-bar {
    background: var(--text); color: #f6efe8;
    font-size: 0.85rem; text-align: center;
}
.announcement-bar .container { padding-top: 7px; padding-bottom: 7px; }
.announcement-bar a { color: inherit; text-decoration: none; }
.announcement-bar a:hover { text-decoration: underline; }

/* ---------- Social showcase (home page, above the footer) ---------- */
.social-showcase {
    background: linear-gradient(135deg, #f3e3d6 0%, #f8eee4 45%, #e9d6c9 100%);
    border-top: 1px solid var(--border);
}
.social-showcase-inner { padding-top: 56px; padding-bottom: 56px; text-align: center; }
.social-showcase-yarn { font-size: 2.4rem; }
.social-showcase h2 { margin: 6px 0 10px; font-size: clamp(1.5rem, 4vw, 2rem); }
.social-showcase p { max-width: 620px; margin: 0 auto 26px; color: #5d524a; }
.social-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.social-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 22px; border-radius: 999px;
    color: #fff; font-weight: 600; text-decoration: none;
    box-shadow: 0 4px 14px rgba(43, 36, 32, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.social-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(43, 36, 32, 0.2); }
.social-btn-instagram { background: linear-gradient(45deg, #f09433, #dc2743 50%, #bc1888); }
.social-btn-facebook { background: #1877f2; }
.social-btn-tiktok { background: #111; }

/* ---------- Footer ---------- */
.site-footer { background: var(--text); color: #d9cfc6; font-size: 0.92rem; }
.site-footer a { color: #f6efe8; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px;
    padding-top: 44px; padding-bottom: 36px;
}
.footer-col h2 {
    margin: 0 0 14px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: #a99c90;
}
.footer-brand { display: inline-block; font-size: 1.25rem; font-weight: 700; }
.footer-tagline { margin: 6px 0 16px; color: #e9e1d9; }
.footer-legal { font-style: normal; line-height: 1.6; margin-bottom: 14px; color: #b9ada2; }
.footer-legal strong { color: #e9e1d9; font-weight: 600; }
.footer-contact, .footer-links, .footer-social { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-social a { display: inline-flex; align-items: center; gap: 10px; }
.footer-payments-heading { margin-top: 24px !important; }
.payment-icons { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.payment-icons svg { display: block; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.footer-note { margin: 10px 0 0; font-size: 0.82rem; color: #a99c90; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.85rem; color: #a99c90; }
.footer-bottom-inner {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding-top: 16px; padding-bottom: 16px;
}
.footer-bottom a { color: #a99c90; }
.footer-bottom-links { display: flex; gap: 16px; }

@media (max-width: 860px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Info pages (delivery, terms) ---------- */
.info-page { max-width: 780px; }
.info-page h1 { margin: 0 0 8px; }
.info-page h2 { margin: 32px 0 10px; font-size: 1.25rem; scroll-margin-top: 90px; }
.info-page li { margin-bottom: 6px; }
.info-lead { font-size: 1.08rem; color: var(--muted); margin-top: 0; }
.info-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.info-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #faf6f1; }
.info-table tr:last-child td { border-bottom: 0; }
.info-table .num { text-align: right; white-space: nowrap; font-weight: 600; }
.info-callout {
    margin-top: 14px; padding: 12px 16px; border-radius: 10px;
    background: #fbefe4; border: 1px solid #efd5c0;
}
.info-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.info-toc a {
    padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); font-size: 0.85rem; text-decoration: none;
}
.info-toc a:hover { border-color: var(--accent); }
.info-updated { margin-top: 32px; font-size: 0.85rem; color: var(--muted); }

/* ---------- "Become a Partner" call to action ---------- */
@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0);
    }
}
@keyframes sparkle-spin {
    0%, 80%, 100% { transform: rotate(0deg) scale(1); }
    90% { transform: rotate(20deg) scale(1.2); }
}

.partner-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px;
    border: none; border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #d1734f 100%);
    color: #fff; font: inherit; font-size: 0.9rem; font-weight: 700; white-space: nowrap;
    cursor: pointer;
    animation: pulse-glow 2.6s ease-in-out infinite;
    transition: background 0.2s ease;
}
.partner-btn-icon { display: inline-block; animation: sparkle-spin 2.6s ease-in-out infinite; }
/* Hold still while the user is about to click, so the target doesn't move. */
.partner-btn:hover, .partner-btn:focus-visible { animation-play-state: paused; background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%); }
.partner-btn:hover .partner-btn-icon { animation-play-state: paused; }
.partner-btn:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.4); outline-offset: 2px; }
.partner-btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.partner-btn-label-short { display: none; }

@media (prefers-reduced-motion: reduce) {
    .partner-btn, .partner-btn-icon { animation: none; }
}
@media (max-width: 480px) {
    .partner-btn:not(.partner-btn-lg) { padding: 7px 12px; }
    .partner-btn-label-full { display: none; }
    .partner-btn-label-short { display: inline; }
}

/* Footer invite band */
.partner-invite { background: linear-gradient(135deg, #3a2f29 0%, #4a3a30 100%); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.partner-invite-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    padding-top: 30px; padding-bottom: 30px;
}
.partner-invite h2 { margin: 0 0 4px; font-size: 1.3rem; color: #fff; }
.partner-invite p { margin: 0; max-width: 620px; color: #d9cfc6; }

/* ---------- Partner modal ---------- */
.partner-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(30, 24, 20, 0.55); }
.partner-modal {
    position: fixed; z-index: 41;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
    background: var(--surface); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modal-in 0.22s ease-out;
}
.partner-modal:focus { outline: none; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@media (prefers-reduced-motion: reduce) { .partner-modal { animation: none; } }
.partner-close {
    position: absolute; top: 12px; right: 12px; z-index: 1;
    width: 36px; height: 36px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.85); font-size: 1.1rem; cursor: pointer; color: var(--text);
}
.partner-close:hover { background: #fff; }
.partner-modal-link { display: block; padding: 0 28px 18px; font-size: 0.82rem; color: var(--muted); text-align: right; }

.partner-page { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }

.partner-content { display: grid; grid-template-columns: 1fr 1.15fr; }
.partner-pitch { padding: 34px 30px; background: linear-gradient(160deg, #f6e7da 0%, #f1dccc 100%); }
.partner-kicker { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.partner-headline { margin: 8px 0 22px; font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.2; }
.partner-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.partner-benefits li { display: flex; gap: 14px; align-items: flex-start; }
.benefit-icon {
    flex: none; width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: #fff; font-size: 1.3rem; box-shadow: 0 2px 6px rgba(43, 36, 32, 0.08);
}
.partner-benefits strong { display: block; }
.partner-benefits p { margin: 2px 0 0; color: #5d524a; font-size: 0.92rem; }

.partner-form-wrap { padding: 30px; }
.partner-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pf-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 13px; flex: 1; min-width: 0; }
.pf-field > span { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.pf-field input, .pf-field textarea {
    width: 100%; padding: 9px 11px;
    border: 1px solid var(--border); border-radius: 8px;
    font: inherit; color: var(--text); background: #fff;
}
.pf-field input:focus, .pf-field textarea:focus { outline: 2px solid rgba(var(--accent-rgb), 0.3); border-color: var(--accent); }
.pf-prefix { display: flex; }
.pf-prefix > span {
    display: flex; align-items: center; padding: 0 10px;
    border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px;
    background: #faf6f1; color: var(--muted); font-weight: 600;
}
.pf-prefix input { border-radius: 0 8px 8px 0; }
.pf-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pf-row > .pf-field { min-width: 180px; }
.partner-form .validation-message { color: #a8322a; font-size: 0.8rem; }
.partner-form input.invalid, .partner-form textarea.invalid { border-color: #a8322a; }
.pf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pf-error { margin-bottom: 12px; padding: 10px 12px; border-radius: 8px; background: #fbe6e3; color: #a8322a; }
.pf-submit { width: 100%; padding: 12px 16px; font-size: 1rem; }
.pf-privacy { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); text-align: center; }

.partner-success { text-align: center; padding: 40px 10px; }
.partner-success-icon { font-size: 3rem; }
.partner-success h3 { margin: 8px 0; font-size: 1.4rem; }
.partner-success p { color: var(--muted); }

@media (max-width: 760px) {
    .partner-content { grid-template-columns: 1fr; }
    .partner-pitch { padding: 26px 20px 22px; }
    .partner-form-wrap { padding: 22px 20px; }
    .partner-modal { top: 16px; transform: translateX(-50%); animation: none; }
}

/* ================= Cart, checkout & orders ================= */
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: #f6efe8; border-color: var(--accent); }
.btn-lg { padding: 13px 18px; font-size: 1.02rem; }
a.btn-block { display: block; text-align: center; }
.notice {
    display: flex; justify-content: space-between; gap: 12px; align-items: center;
    margin-bottom: 16px; padding: 10px 14px; border-radius: 10px;
    background: #fbefe4; border: 1px solid #efd5c0;
}
.empty-icon { font-size: 2.6rem; }
.form-error { display: block; margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: #fbe6e3; color: #a8322a; }
.form-error.small { padding: 4px 0; background: none; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > .form-field { flex: 1; min-width: 200px; }
.form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-field > span { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.form-field input, .form-field select, .form-field textarea,
.promo-row input {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    background: #fff; font: inherit; color: var(--text);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .promo-row input:focus {
    outline: 2px solid rgba(var(--accent-rgb), 0.3); border-color: var(--accent);
}
.validation-message { color: #a8322a; font-size: 0.82rem; }
input.invalid, textarea.invalid, select.invalid { border-color: #a8322a !important; }

/* Cart page */
.cart-layout, .checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.cart-lines { display: flex; flex-direction: column; gap: 12px; }
.cart-line {
    display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: start;
    padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.cart-line-image {
    width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; background: #f1ebe3; font-size: 2rem; text-decoration: none;
}
.cart-line-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-line-title { font-weight: 700; text-decoration: none; }
.cart-line-title:hover { color: var(--accent); }
.cart-line-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.cart-line-total { font-weight: 700; white-space: nowrap; }

.summary-panel {
    position: sticky; top: 90px;
    padding: 20px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.summary-panel h2 { margin: 0 0 14px; font-size: 1.2rem; }
.promo-form { margin-bottom: 16px; }
.promo-form label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.promo-row { display: flex; gap: 8px; }
.promo-ok { display: block; margin-top: 6px; color: #2f7d4f; font-weight: 600; }
.summary-lines { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0 0 12px; font-size: 0.95rem; }
.summary-lines dt { color: var(--muted); }
.summary-lines dd { margin: 0; text-align: right; }
.summary-lines .discount { color: #2f7d4f; font-weight: 600; }
.summary-total {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 12px 0 16px; border-top: 1px solid var(--border); font-size: 1.1rem;
}
.summary-total strong { font-size: 1.4rem; }
.summary-note { margin: 10px 0 0; text-align: center; }

/* Checkout */
.checkout-section {
    margin: 0 0 18px; padding: 18px 20px; min-width: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.checkout-section legend { padding: 0 6px; font-weight: 700; font-size: 1.05rem; }
.pay-options { display: grid; gap: 10px; }
.pay-option {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.pay-option:hover { border-color: var(--accent); }
.pay-option.selected { border-color: var(--accent); background: #fbf3ec; box-shadow: 0 0 0 1px var(--accent) inset; }
.pay-option input { accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.pay-icon { font-size: 1.4rem; width: 28px; text-align: center; }
.pay-text { display: flex; flex-direction: column; }
.summary-items { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.summary-items li, .order-items li, .order-card-items li { display: flex; align-items: center; gap: 10px; }
.summary-item-title { flex: 1; min-width: 0; font-size: 0.92rem; }
.summary-thumb {
    position: relative; flex: none; width: 48px; height: 48px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; background: #f1ebe3;
}
.summary-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.summary-qty {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; background: var(--text); color: #fff; font-size: 0.72rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* Order page */
.order-thanks {
    display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding: 16px 18px;
    border-radius: var(--radius); background: #e8f4ec; border: 1px solid #bfe0cb; font-size: 1.6rem;
}
.order-thanks div { display: flex; flex-direction: column; font-size: 1rem; }
.order-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.order-header h1 { margin: 0; }
.order-header p { margin: 4px 0 0; }
.order-badge { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.order-badge-pending { background: #fdf1d8; color: #8a5a00; }
.order-badge-verifying { background: #e5eef7; color: #2d5c8a; }
.order-badge-failed { background: #fbe6e3; color: #a8322a; }
.order-badge-processing { background: #efe6f7; color: #6a3d93; }
.order-badge-shipped { background: #e3f1f5; color: #1f6a80; }
.order-badge-delivered { background: #e5f3ea; color: #2f7d4f; }
.order-badge-cancelled { background: #eee9e3; color: #5d544d; }
.order-pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.bank-card, .receipt-card, .retry-card, .order-items, .order-delivery, .lookup-card, .order-card {
    padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.bank-card { background: #fbf6f0; }
.bank-card h3, .receipt-card h3 { margin: 0 0 12px; font-size: 1.05rem; }
.bank-details { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; }
.bank-details dt { color: var(--muted); font-size: 0.88rem; }
.bank-details dd { margin: 0; min-width: 0; }
.bank-details code { font-size: 0.95rem; font-weight: 700; word-break: break-all; }
.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-btn { padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font: inherit; font-size: 0.78rem; cursor: pointer; }
.copy-btn:hover { border-color: var(--accent); }
.bank-note { margin: 12px 0 0; font-size: 0.88rem; color: #5d524a; }
.receipt-state.ok { color: #2f7d4f; font-weight: 600; }
.receipt-drop {
    display: flex; align-items: center; gap: 12px; position: relative;
    padding: 16px; border: 2px dashed #d9c6b5; border-radius: 12px; cursor: pointer; background: #fffcf9;
}
.receipt-drop:hover { border-color: var(--accent); }
.receipt-drop.busy { opacity: 0.6; cursor: progress; }
.receipt-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.receipt-drop > span:last-child { display: flex; flex-direction: column; }
.receipt-drop-icon { font-size: 1.6rem; }
.retry-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; background: #fbf3ec; }
.retry-card p { margin: 0; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.order-items h2, .order-delivery h2 { margin: 0 0 12px; font-size: 1.15rem; }
.order-items ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.order-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.order-item-info a { font-weight: 600; text-decoration: none; }

/* My orders */
.lookup-card { margin-bottom: 22px; }
.lookup-card h2 { margin: 0 0 10px; font-size: 1.1rem; }
.lookup-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.lookup-form .form-field { flex: 1; min-width: 200px; margin-bottom: 0; }
.order-list { display: grid; gap: 14px; }
.order-card header, .order-card footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-card-ref { font-weight: 800; font-size: 1.05rem; margin-right: 8px; text-decoration: none; }
.order-card-ref:hover { color: var(--accent); }
.order-card-items { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; }

@media (max-width: 860px) {
    .cart-layout, .checkout-layout, .order-grid, .order-pay-grid { grid-template-columns: 1fr; }
    .summary-panel { position: static; }
}
@media (max-width: 480px) {
    .cart-line { grid-template-columns: 72px minmax(0, 1fr); }
    .cart-line-image { width: 72px; height: 72px; }
    .cart-line-total { grid-column: 2; }
}

/* ---------- Featured cards (above the category filter) ---------- */
/* Desktop: 3 per row (grid-cols-3 gap-4). Mobile: horizontal scroll with snap (flex overflow-x-auto snap-x). */
.featured-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 22px; }
.featured-card {
    position: relative; display: block; overflow: hidden;
    height: 184px;                                   /* ~h-44/h-48 */
    border-radius: 16px;                             /* rounded-2xl */
    color: #fff; text-decoration: none;
    box-shadow: var(--shadow);
    isolation: isolate;
}
/* Fallback backgrounds when no photo is configured. */
.featured-card-1 { background: linear-gradient(135deg, #8a5a44 0%, #c58b62 100%); }
.featured-card-2 { background: linear-gradient(135deg, #4f6b52 0%, #8aa98a 100%); }
.featured-card-3 { background: linear-gradient(135deg, #7a4a5a 0%, #c3828f 100%); }

.featured-card-img, .featured-card-icon { transition: transform 0.3s ease; }   /* group-hover:scale-105 duration-300 */
.featured-card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.featured-card-icon {
    position: absolute; right: 18px; top: 50%; translate: 0 -55%;
    font-size: 4.2rem; opacity: 0.9; z-index: -2;
}
.featured-card:hover .featured-card-img,
.featured-card:hover .featured-card-icon { transform: scale(1.05); }

/* Dark gradient at the bottom keeps the white title readable (from-black/70 via-black/20 to-transparent). */
.featured-card::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 45%, transparent 75%);
}
.featured-card-title {
    position: absolute; left: 18px; bottom: 14px; right: 18px;
    font-size: 1.25rem; font-weight: 700; line-height: 1.2;            /* text-xl font-bold */
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);                        /* drop-shadow-md */
}
.featured-card:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.5); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .featured-card-img, .featured-card-icon { transition: none; }
    .featured-card:hover .featured-card-img, .featured-card:hover .featured-card-icon { transform: none; }
}

@media (max-width: 760px) {
    .featured-cards {
        display: flex; gap: 12px;
        overflow-x: auto; scroll-snap-type: x mandatory;
        padding-bottom: 6px; scrollbar-width: thin;
    }
    .featured-card { flex: 0 0 78%; height: 160px; scroll-snap-align: start; }
}

/* ---------- "Coming soon" placeholder pages ---------- */
.coming-soon { max-width: 560px; margin: 24px auto 0; padding: 40px 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.coming-soon-icon { font-size: 3rem; }
.coming-soon h1 { margin: 8px 0; }
.coming-soon p { margin: 0 0 20px; }

/* ---------- Language switcher (header) ---------- */
.lang-switcher { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.9rem; }
.lang-switcher select {
    padding: 6px 8px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.lang-switcher select:focus { outline: 2px solid rgba(var(--accent-rgb), 0.35); border-color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 420px) { .lang-switcher > span[aria-hidden] { display: none; } }

/* ---------- WhatsApp ---------- */
/* Floating chat button: fixed bottom-6 right-6, brand green, gentle pulse ring. Sits under the
   basket drawer (z-index 30) and modals, above page content. */
.wa-float {
    position: fixed; right: 24px; bottom: 24px; z-index: 25;
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #25D366; color: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.wa-float::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
    animation: wa-pulse 2.8s ease-out infinite;
}
@keyframes wa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
    70%, 100% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
}
.wa-float:hover { background: #128C7E; transform: translateY(-2px); }
.wa-float:focus-visible { outline: 3px solid rgba(37, 211, 102, 0.5); outline-offset: 3px; }
.wa-float-tip {
    position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    padding: 7px 12px; border-radius: 8px;
    background: #1F2937; color: #fff; font-size: 0.85rem; font-weight: 600; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.wa-float:hover .wa-float-tip, .wa-float:focus-visible .wa-float-tip { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .wa-float::before { animation: none; } }
@media (max-width: 520px) {
    .wa-float { right: 16px; bottom: 16px; width: 52px; height: 52px; }
    .wa-float-tip { display: none; }
}

/* Product page: order / inquiry via WhatsApp. */
.wa-order-row { margin-top: 10px; max-width: 520px; }
.wa-order-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px;
    background: #25D366; color: #fff; font-weight: 600; text-decoration: none;
    transition: background-color 0.15s ease;
}
.wa-order-btn:hover { background: #128C7E; }
.wa-order-btn:focus-visible { outline: 3px solid rgba(37, 211, 102, 0.5); outline-offset: 2px; }
.wa-order-btn-block { width: 100%; }
@media (max-width: 640px) { .wa-order-row { max-width: none; } }

/* ================= Pagination ================= */
.pagination {
    margin-top: 40px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.pagination-controls {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
}
.pagination-btn {
    min-width: 40px; padding: 7px 12px;
    font-size: 0.9rem; border-radius: 8px;
}
.pagination-btn--active {
    background: var(--accent); color: #fff; border: 1px solid var(--accent);
    font-weight: 600;
}
.pagination-btn--active:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pagination-ellipsis {
    display: flex; align-items: center; padding: 7px 4px;
    color: var(--muted); font-size: 0.9rem; user-select: none;
}
.pagination-summary { margin: 0; text-align: center; }
@media (max-width: 480px) {
    .pagination-btn { min-width: 34px; padding: 6px 8px; font-size: 0.82rem; }
}

/* ================= Comments ================= */
.product-comments { margin-top: 48px; }
.comments-heading { font-size: 1.2rem; font-weight: 700; margin: 0 0 20px; }
.comments-disabled-notice { padding: 16px; border-radius: var(--radius); background: var(--bg); color: var(--muted); font-size: 0.9rem; }

/* --- Facebook login gate (unauthenticated) --- */
.fb-login-gate {
    display: flex; justify-content: center;
    padding: 32px 16px; margin-bottom: 28px;
    border: 1px dashed var(--border); border-radius: 20px;
    background: var(--surface);
}
.fb-login-gate-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 360px; text-align: center; }
.fb-login-gate-icon { font-size: 2rem; }
.fb-login-gate-text { margin: 0; font-size: 0.95rem; color: var(--muted); line-height: 1.5; }
.fb-login-btn {
    display: inline-flex; align-items: center; gap: 10px;
    background: #1877F2; color: #fff; font-size: 0.95rem; font-weight: 600;
    padding: 12px 22px; border-radius: 12px; border: none; cursor: pointer;
    transition: background-color 0.15s ease;
}
.fb-login-btn:hover { background: #166FE5; }
.fb-login-btn:focus-visible { outline: 3px solid rgba(24, 119, 242, 0.4); outline-offset: 2px; }
.fb-login-btn svg { flex-shrink: 0; }

/* --- Facebook comment box (authenticated) --- */
.fb-comment-box {
    margin-bottom: 28px; padding: 20px;
    border: 1px solid var(--border); border-radius: 20px;
    background: var(--surface);
}
.fb-user-bar {
    display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
    padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.fb-user-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 2px solid var(--border);
}
.fb-user-avatar-placeholder {
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
    background: #e4e6eb; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.fb-user-info { flex: 1; min-width: 0; }
.fb-user-name { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 6px; }
.fb-verified-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; font-weight: 600; color: #1877F2;
    background: rgba(24, 119, 242, 0.08); padding: 2px 7px; border-radius: 20px;
}
.fb-logout-link {
    background: none; border: none; cursor: pointer;
    font-size: 0.8rem; color: var(--muted); padding: 4px 0;
    text-decoration: underline; text-underline-offset: 2px;
    transition: color 0.1s;
}
.fb-logout-link:hover { color: var(--text); }

.fb-textarea-box {
    border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fb-textarea-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.fb-textarea-box textarea {
    width: 100%; display: block; resize: none;
    padding: 14px 16px; border: none; outline: none; background: transparent;
    font-size: 0.95rem; font-family: inherit; color: var(--text); line-height: 1.5;
}
.fb-form-actions {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px 10px 16px;
    border-top: 1px solid var(--border); background: var(--bg);
}
.char-count { font-size: 0.8rem; color: var(--muted); }
.char-count-warn { color: #d97706; font-weight: 600; }
.comment-submit-btn { padding: 8px 20px; font-size: 0.9rem; }

.comments-rate-limit {
    padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
    background: #fef3c7; color: #92400e; font-size: 0.875rem;
}

/* --- Comment list --- */
.comment-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.comments-empty { margin-top: 8px; }

.comment-card {
    display: flex; gap: 12px;
    padding: 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
}
.comment-avatar { flex-shrink: 0; }
.comment-avatar img {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border);
}
.comment-avatar-placeholder {
    width: 40px; height: 40px; border-radius: 50%;
    background: #e4e6eb; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.comment-author-row { display: flex; align-items: center; gap: 6px; }
.comment-author { font-size: 0.9rem; font-weight: 700; }
.comment-fb-icon { color: #1877F2; flex-shrink: 0; }
.comment-time { font-size: 0.8rem; }
.comment-content { margin: 0; font-size: 0.9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

@media (max-width: 480px) {
    .fb-form-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
    .comment-card { padding: 12px; }
}


/* --- Expandable orders table --- */
.orders-expandable .order-row:hover { background: var(--surface); }
.orders-expandable .order-row.expanded { background: var(--surface); }
.expand-cell { color: var(--muted); font-size: 0.7rem; padding-right: 0; user-select: none; }
.expand-icon { display: inline-block; transition: transform .15s; }

.order-details-row > td { padding: 0 !important; border-bottom: 2px solid var(--border); }
.order-detail-card {
    padding: 1rem 1.25rem 0.75rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.order-detail-card .items-table th,
.order-detail-card .items-table td { font-size: 0.82rem; }

.order-summary-bar {
    display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
    padding: .65rem .25rem;
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: .5rem;
    color: var(--muted);
}
.order-summary-bar strong { color: var(--text); }

.profit-pos { color: #16a34a; }
.profit-neg { color: #dc2626; }


/* --- Pricing breakdown card (ProductEdit) --- */
.pricing-breakdown {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    background: var(--surface);
    margin: .25rem 0 1rem;
    font-size: 0.88rem;
}
.pb-row {
    display: flex;
    justify-content: space-between;
    padding: .3rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}
.pb-row:last-child { border-bottom: none; }
.pb-seller { color: var(--text); font-weight: 600; }
.pb-retail {
    color: var(--primary, #5a3a1a);
    font-weight: 700;
    font-size: 1rem;
    margin-top: .25rem;
    border-top: 2px solid var(--border);
    border-bottom: none;
    padding-top: .5rem;
}
.pb-override { margin-top: .75rem; border-top: 1px dashed var(--border); padding-top: .75rem; }

/* --- Made-to-order / out-of-stock states (ProductDetails) --- */
.out-of-stock-final { color: var(--danger, #c0392b); font-weight: 600; }
.made-to-order-note {
    font-size: 0.9rem;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .5rem .75rem;
    margin: 0 0 .75rem;
}
.purchase-box-unavailable { opacity: .55; }
.purchase-box-unavailable .buy-btn { cursor: not-allowed; }
.unavailable-note {
    font-size: 0.85rem;
    color: var(--danger, #c0392b);
    margin: .5rem 0 0;
}

/* ====================================================================
   Auction pages
   ==================================================================== */

/* Hero banner */
.auction-hero {
    background: linear-gradient(135deg, #b5543c 0%, #7a3020 100%);
    border-radius: var(--radius);
    padding: 48px 32px;
    margin-bottom: 40px;
    text-align: center;
    color: #fff;
}
.auction-hero-title { font-size: 2rem; margin: 0 0 12px; }
.auction-hero-subtitle { font-size: 1.05rem; opacity: .9; margin: 0 0 24px; max-width: 540px; margin-left: auto; margin-right: auto; }

/* Accent button */
.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    transition: background .2s;
}
.btn-accent:hover { background: var(--accent-hover); }
.auction-hero .btn-accent { background: #fff; color: var(--accent); }
.auction-hero .btn-accent:hover { background: #f5ede8; }

/* Grid */
.auction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 8px;
}

/* Card */
.auction-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .15s;
}
.auction-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.auction-card-img-wrap { height: 200px; overflow: hidden; background: var(--bg); }
.auction-card-img { width: 100%; height: 100%; object-fit: cover; }
.auction-card-img-placeholder {
    height: 200px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    background: var(--bg);
}

.auction-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.auction-card-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.auction-card-desc { font-size: .88rem; margin: 0; flex: 1; }
.auction-card-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.auction-card-budget { font-weight: 700; color: var(--accent); font-size: .95rem; }
.auction-card-by, .auction-card-date { font-size: .8rem; }

/* Detail page */
.auction-detail { display: flex; flex-direction: column; gap: 32px; }
.auction-detail-main { display: flex; gap: 32px; flex-wrap: wrap; }
.auction-detail-img-wrap { flex: 0 0 auto; width: 380px; max-width: 100%; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.auction-detail-img { width: 100%; height: 320px; object-fit: cover; }
.auction-detail-info { flex: 1 1 300px; }
.auction-detail-title { font-size: 1.6rem; margin: 0 0 16px; }
.auction-detail-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.auction-budget-badge {
    background: rgba(var(--accent-rgb), .12);
    color: var(--accent);
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .9rem;
}
.auction-detail-desc { line-height: 1.7; white-space: pre-wrap; }

/* Post / edit form */
.auction-post-page { max-width: 680px; }
.auction-post-page h1 { margin-bottom: 8px; }
.auction-validation-summary { color: var(--danger, #c0392b); margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-group label { font-weight: 600; font-size: .95rem; }
.form-control {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-sizing: border-box;
    transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea.form-control { resize: vertical; min-height: 96px; }
.form-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 24px 0 0; }
.form-fieldset legend { font-weight: 600; padding: 0 6px; }
.auction-form-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

/* Success screen */
.auction-success { text-align: center; padding: 40px 0; }
.auction-success-icon { font-size: 3.5rem; margin-bottom: 16px; }
.auction-success h1 { margin-bottom: 12px; }
.auction-success-token-box {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px auto;
    max-width: 600px;
    text-align: left;
}
.auction-edit-link {
    display: block;
    word-break: break-all;
    font-size: .85rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 8px 0;
}
.auction-success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* Breadcrumb */
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Auction loading / empty */
.auction-loading { margin-top: 40px; text-align: center; }
.auction-empty { text-align: center; padding: 60px 0; }
.auction-empty-icon { font-size: 3rem; margin-bottom: 16px; }

/* Header auction link accent */
.header-link-auction { color: var(--accent) !important; font-weight: 700 !important; }

/* Admin auction thumbnail */
.auction-admin-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }

/* Admin auction inline edit */
.auction-inline-edit { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.auction-inline-edit input, .auction-inline-edit textarea { font-size: .85rem; padding: 4px 8px; }

/* Partner apply grid */
.auction-partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.auction-partner-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.auction-partner-card.applied { border-color: var(--accent); }
.auction-partner-card-img { width: 100%; height: 160px; object-fit: cover; }
.auction-partner-card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.auction-partner-card-body h3 { margin: 0; font-size: 1rem; }
.auction-partner-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auction-applied-badge { color: var(--accent); font-weight: 700; font-size: .88rem; }
.auction-apply-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* Auction hero action row */
.auction-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255,255,255,.7);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.btn-outline-light:hover { background: rgba(255,255,255,.15); }

/* ---- Customer "My Requests" dashboard ---- */
.auction-my-requests { max-width: 860px; margin: 0 auto; padding: 24px 0 48px; }
.auction-my-requests h1 { margin-bottom: 4px; }
.auction-my-requests .subtitle { color: var(--muted); margin-bottom: 28px; }
.loading-msg { color: var(--muted); text-align: center; margin-top: 40px; }

.my-request-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.my-request-card.status-approved { border-left: 4px solid #22a050; }
.my-request-card.status-rejected { border-left: 4px solid #d94040; }
.my-request-card.status-pending  { border-left: 4px solid #c8a030; }
.my-request-card.pay-paid        { border-left: 4px solid #22a050; }

.mrc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mrc-title-area { display: flex; align-items: flex-start; gap: 14px; }
.mrc-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.mrc-title-area h2 { font-size: 1.1rem; margin: 0 0 6px; }
.mrc-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

/* Status / pay chips (used on both storefront and admin pages) */
.status-chip {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    vertical-align: middle;
    white-space: nowrap;
}
.status-chip + .status-chip { margin-left: 4px; }
.status-pending  { background: #fff3cd; color: #856404; }
.status-approved,
.status-visible  { background: #d1e7dd; color: #0a3622; }
.status-rejected,
.status-deleted  { background: #f8d7da; color: #842029; }
.status-hidden   { background: #e8e0d6; color: #5d544d; }
.status-chip-warning { background: #cff4fc; color: #0c5460; }

.pay-chip {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}
.pay-chip:empty { display: none; }
.pay-awaiting       { background: #fff3cd; color: #856404; }
.pay-pending-verify { background: #cff4fc; color: #0c5460; }
.pay-paid           { background: #d1e7dd; color: #0a3622; }
.pay-failed         { background: #f8d7da; color: #842029; }

.rejection-note { color: #d94040; font-size: .88rem; margin: 10px 0 0; }
.error-msg { color: #d94040; font-size: .88rem; margin: 8px 0 0; }
.mrc-info { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }

/* Applications list */
.mrc-applications { margin-top: 18px; }
.mrc-applications h3 { font-size: .95rem; margin: 0 0 10px; }
.app-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg);
}
.app-row.app-accepted { border-color: #22a050; background: #f0faf4; }
.app-info { display: flex; flex-direction: column; gap: 2px; }
.app-info strong { font-size: .95rem; }
.app-note { color: var(--muted); font-size: .85rem; }
.app-date { color: var(--muted); font-size: .8rem; }

/* Payment section */
.payment-section {
    margin-top: 20px;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fefaf5;
}
.payment-section h3 { margin: 0 0 10px; font-size: 1rem; }
.payment-pending { background: #f0f9ff; }
.payment-paid    { background: #f0faf4; }
.payment-failed  { background: #fff5f5; }

/* Receipt upload */
.receipt-upload { margin-top: 14px; }
.receipt-upload h4 { font-size: .9rem; margin: 0 0 8px; color: var(--muted); }
.receipt-upload input[type="file"] { display: block; margin-bottom: 10px; }

/* Responsive */
@media (max-width: 600px) {
    .auction-hero { padding: 32px 16px; }
    .auction-hero-title { font-size: 1.5rem; }
    .auction-detail-main { flex-direction: column; }
    .auction-detail-img-wrap { width: 100%; }
    .auction-grid { grid-template-columns: 1fr; }
    .mrc-header { flex-direction: column; }
    .app-row { flex-direction: column; align-items: flex-start; }
}
