/* =============================================================
   Guapa — Site design tokens & component utilities
   -------------------------------------------------------------
   This file ships AFTER style.css. It adds:
     1. CSS custom properties (single source of truth for colours,
        spacing, radii, shadows) so future pages can stay coherent.
     2. Styles for the new <x-site.*> Blade components.
     3. A small set of utility classes (.u-*) the new pages use.
   It must not redefine selectors that exist in style.css unless
   the goal is to fix a clear bug — additive only.
   ============================================================= */

:root {
    /* Brand */
    --c-primary:        #633479;
    --c-primary-dark:   #4a2659;
    --c-primary-soft:   #ebe1f0;
    --c-accent:         #d4af37;

    /* Neutrals */
    --c-ink:            #1d1d1d;
    --c-ink-2:          #4a4a4a;
    --c-muted:          #7a7a7a;
    --c-line:           #e8e8e8;
    --c-bg:             #ffffff;
    --c-bg-soft:        #fafafa;

    /* Status */
    --c-success:        #1f8a3a;
    --c-success-bg:     #e7f4ec;
    --c-warning:        #b07b00;
    --c-warning-bg:     #fff6dc;
    --c-danger:         #c0392b;
    --c-danger-bg:      #fbeae8;
    --c-info:           #1f5d8a;
    --c-info-bg:        #e6f1f8;

    /* Spacing */
    --s-1: .25rem;
    --s-2: .5rem;
    --s-3: .75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-7: 3rem;

    /* Radii & shadows */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  16px;
    --r-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.03);
    --shadow-md: 0 4px 14px rgba(0,0,0,.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,.08);

    /* Motion */
    --t-fast: 120ms;
    --t-base: 200ms;
}

/* Respect user motion preferences. */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ---------- Breadcrumb ----------------------------------------- */
.site-breadcrumb {
    font-size: .85rem;
    color: var(--c-muted);
    margin: var(--s-4) 0;
}
.site-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}
.site-breadcrumb li + li::before {
    content: "›";
    margin-inline-end: var(--s-2);
    opacity: .55;
}
.site-breadcrumb a {
    color: inherit;
    text-decoration: none;
}
.site-breadcrumb a:hover { color: var(--c-primary); }

/* ---------- Section / hero ------------------------------------- */
.site-hero--compact { padding-block: var(--s-5); }
.site-section__heading { text-align: center; margin-bottom: var(--s-6); }
.site-section__eyebrow {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: var(--r-pill);
    background: var(--c-primary-soft);
    color: var(--c-primary-dark);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: var(--s-3);
}
.site-section--muted  { background: var(--c-bg-soft); }
.site-section--accent { background: var(--c-primary-soft); }

/* ---------- Card ------------------------------------------------ */
.site-card {
    background: var(--c-bg);
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t-base), transform var(--t-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.site-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.site-card__image { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--c-bg-soft); }
.site-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-card__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.site-card__eyebrow {
    font-size: .75rem;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.site-card__title { font-size: 1.1rem; margin: 0; line-height: 1.4; }
.site-card__title a { color: inherit; text-decoration: none; }
.site-card__title a:hover { color: var(--c-primary); }
.site-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    font-size: .85rem;
    color: var(--c-muted);
}

/* ---------- Empty state ---------------------------------------- */
.site-empty {
    text-align: center;
    padding: var(--s-7) var(--s-4);
    color: var(--c-muted);
}
.site-empty__icon  { width: 64px; height: 64px; margin: 0 auto var(--s-4); opacity: .7; }
.site-empty__title { font-size: 1.1rem; color: var(--c-ink-2); margin-bottom: var(--s-2); }
.site-empty__hint  { font-size: .9rem; }

/* ---------- Alerts --------------------------------------------- */
.site-alert {
    display: flex;
    gap: var(--s-3);
    align-items: flex-start;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    margin: var(--s-3) 0;
    border: 1px solid transparent;
    font-size: .95rem;
}
.site-alert__icon { font-weight: 700; }
.site-alert--success { background: var(--c-success-bg); border-color: #c6e6d2; color: var(--c-success); }
.site-alert--warning { background: var(--c-warning-bg); border-color: #f0d97f; color: var(--c-warning); }
.site-alert--danger  { background: var(--c-danger-bg);  border-color: #f5c6c0; color: var(--c-danger);  }
.site-alert--info    { background: var(--c-info-bg);    border-color: #c8e0ee; color: var(--c-info);    }

/* ---------- Form fields ---------------------------------------- */
.site-field { margin-bottom: var(--s-4); }
.site-field__label {
    display: block;
    font-size: .9rem;
    font-weight: 600;
    color: var(--c-ink-2);
    margin-bottom: var(--s-2);
}
.site-field__label span { color: var(--c-danger); }
.site-field__input { width: 100%; }
.site-field.is-invalid .site-field__input { border-color: var(--c-danger); }
.site-field__hint  { display: block; margin-top: var(--s-1); color: var(--c-muted); font-size: .8rem; }
.site-field__error { display: block; margin-top: var(--s-1); color: var(--c-danger); font-size: .8rem; }

/* ---------- Page loading overlay tweak ------------------------ */
.page-loading-overlay { transition: opacity var(--t-base) ease-out; }

/* ---------- Generic utilities (sparing use) ------------------- */
.u-mt-2 { margin-top: var(--s-2); }
.u-mt-4 { margin-top: var(--s-4); }
.u-mt-6 { margin-top: var(--s-6); }
.u-mb-4 { margin-bottom: var(--s-4); }
.u-mb-6 { margin-bottom: var(--s-6); }
.u-text-center { text-align: center; }
.u-muted { color: var(--c-muted); }
.u-no-wrap { white-space: nowrap; }
.u-cursor-pointer { cursor: pointer; }

/* ---------- Focus-visible (accessibility) --------------------- */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

/* ---------- Image defaults (prevent layout shift) ------------- */
img[loading="lazy"] { content-visibility: auto; }

/* =============================================================
   Site-wide polish (v2) — additive, low-risk refinements applied
   on every page. Tasteful motion + brand-consistent focus.
   No layout/structure/colour-scheme changes; safe over Bootstrap.
   ============================================================= */

html { scroll-behavior: smooth; }

::selection { background: var(--c-primary); color: #fff; }

/* Brand-consistent focus ring on inputs (replaces Bootstrap's blue). */
.form-control:focus,
.custom-select:focus,
select:focus,
textarea:focus,
input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--c-primary) !important;
    box-shadow: 0 0 0 .18rem rgba(99, 52, 121, .15) !important;
    outline: none;
}

/* Buttons: subtle polished motion (no size/colour change). */
.btn, .custom-btn, button[type="submit"], .product-cart-add-btn {
    transition: transform var(--t-fast) ease, box-shadow var(--t-base) ease,
                background-color var(--t-base) ease, filter var(--t-base) ease;
}
.btn:hover, .custom-btn:hover { transform: translateY(-1px); }
.btn:active, .custom-btn:active { transform: translateY(0); }
.custom-btn.primary-btn:hover { box-shadow: 0 6px 18px rgba(99, 52, 121, .22); }

/* Cards / product cards: gentle lift on hover. */
.card, .product-card {
    transition: box-shadow var(--t-base) ease, transform var(--t-base) ease;
}
.card:hover, .product-card:hover { box-shadow: var(--shadow-md); }

/* Smooth link colour transitions. */
a { transition: color var(--t-fast) ease; }

/* Inline variant-picker hint — clearer than a browser alert. */
.product-variant-picker .pvp-hint {
    margin-top: var(--s-3);
    padding: var(--s-2) var(--s-3);
    background: var(--c-danger-bg);
    border: 1px solid #f5c6c0;
    border-radius: var(--r-sm);
    color: var(--c-danger);
    font-weight: 600;
}

/* Never let an image overflow its box. */
img { max-width: 100%; }

/* ---------- Skip link (keyboard accessibility) ---------------- */
.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    top: 0;
    z-index: 100000;
    background: var(--c-primary);
    color: #fff;
    padding: .6rem 1rem;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus {
    inset-inline-start: 1rem;
    top: 0;
    outline: 2px solid var(--c-accent);
}
#main-content:focus { outline: none; }
