/* ==========================================================================
   Tsilivi Jewels – shared components (DESIGN.md §3)
   Loaded AFTER style.css and BEFORE page CSS (@section pagecss), so page
   stylesheets can still specialise anything defined here.

   Contents
     1. Buttons (.btn brand style, variants, Bootstrap mapping)
     2. Product price / cart / wishlist buttons (moved from style.css)
     3. Forms
     4. Breadcrumb
     5. Section header
     6. Card
     7. Badges
     8. Empty state (moved from orderHistory.css – used by cart & wishlist too)
     9. Alerts
    10. Modal
    11. SweetAlert theme (moved from style.css)
    12. Pagination
    13. Reveal animation
    14. Utilities
   ========================================================================== */


/* 1. Buttons ============================================================== */

.btn {
    display: inline-block;
    min-height: 44px;
    padding: 11px 27px; /* + 1px border = 12px 28px */
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.5;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--text-on-dark);
    background-color: var(--brand-plum);
    border: 1px solid var(--brand-plum);
    border-radius: var(--radius-0);
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

    .btn:hover {
        color: var(--text-on-dark);
        background-color: var(--brand-plum-deep);
        border-color: var(--brand-plum-deep);
    }

    .btn:focus {
        box-shadow: none;
    }

    .btn:focus-visible {
        outline: none;
        box-shadow: var(--ring);
    }

    .btn:disabled,
    .btn.disabled,
    fieldset:disabled .btn {
        opacity: .55;
        pointer-events: none;
    }

@media (max-width: 767.98px) {
    .btn {
        padding-inline: 19px;
    }
}

.btn-sm,
.btn.btn-sm {
    min-height: 36px;
    padding: 7px 15px;
    font-size: var(--fs-xs);
}

.btn-outline-brand,
.btn.btn-outline-brand {
    color: var(--brand-plum);
    background-color: transparent;
    border-color: var(--brand-plum);
}

    .btn-outline-brand:hover,
    .btn.btn-outline-brand:hover {
        color: var(--text-on-dark);
        background-color: var(--brand-plum);
        border-color: var(--brand-plum);
    }

.btn-gold,
.btn.btn-gold {
    color: var(--brand-plum-deep);
    background-color: var(--brand-gold);
    border-color: var(--brand-gold);
}

    .btn-gold:hover,
    .btn.btn-gold:hover {
        color: var(--brand-plum-deep);
        background-color: var(--brand-gold-light);
        border-color: var(--brand-gold-light);
    }

.btn-light-brand,
.btn.btn-light-brand {
    color: var(--brand-plum);
    background-color: var(--surface);
    border-color: var(--surface);
}

    .btn-light-brand:hover,
    .btn.btn-light-brand:hover {
        color: var(--brand-plum-deep);
        background-color: var(--brand-gold-light);
        border-color: var(--brand-gold-light);
    }

/* Bootstrap variants mapped onto the brand. Scoped to `.btn.` because several
   pages use bare `.btn-primary` / `.btn-secondary` classes with their own page
   styles (profile, about, FAQ, retailers) – those must not be affected. */
.btn.btn-primary {
    color: var(--text-on-dark);
    background-color: var(--brand-plum);
    border-color: var(--brand-plum);
}

    .btn.btn-primary:hover,
    .btn.btn-primary:active {
        color: var(--text-on-dark);
        background-color: var(--brand-plum-deep);
        border-color: var(--brand-plum-deep);
    }

.btn.btn-outline-primary {
    color: var(--brand-plum);
    background-color: transparent;
    border-color: var(--brand-plum);
}

    .btn.btn-outline-primary:hover,
    .btn.btn-outline-primary:active {
        color: var(--text-on-dark);
        background-color: var(--brand-plum);
        border-color: var(--brand-plum);
    }

.btn.btn-secondary {
    color: var(--brand-plum);
    background-color: var(--surface-sand);
    border-color: var(--surface-sand);
}

    .btn.btn-secondary:hover,
    .btn.btn-secondary:active {
        color: var(--brand-plum);
        background-color: var(--line);
        border-color: var(--line);
    }

.btn.btn-outline-secondary {
    color: var(--text-muted);
    background-color: transparent;
    border-color: var(--line-strong);
}

    .btn.btn-outline-secondary:hover,
    .btn.btn-outline-secondary:active {
        color: var(--brand-plum);
        background-color: var(--surface-sand);
        border-color: var(--line-strong);
    }

.btn.btn-primary:focus,
.btn.btn-outline-primary:focus,
.btn.btn-secondary:focus,
.btn.btn-outline-secondary:focus {
    box-shadow: none;
}

.btn.btn-primary:focus-visible,
.btn.btn-outline-primary:focus-visible,
.btn.btn-secondary:focus-visible,
.btn.btn-outline-secondary:focus-visible {
    box-shadow: var(--ring);
}


/* 2. Product price / cart / wishlist buttons ================================
   Moved here from style.css unchanged in specificity: these elements also
   carry `.btn`, so they must come after the brand .btn rules to keep
   overriding them (as they did inside style.css). Shared by the product list,
   product details, wishlist and the add-to-cart modal. */

.blurred-price {
    cursor: pointer;
    min-height: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--text) !important; /* was #333 !important – beats per-page price colours */
    font-size: 1.5rem;
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    transition: all 0.2s ease;
}

    .blurred-price:hover,
    .blurred-price:focus,
    .blurred-price:active {
        background: transparent;
        border-color: transparent;
    }

    .blurred-price span {
        display: inline-block;
        filter: blur(2.8px);
        opacity: 0.65;
        color: var(--text);
        user-select: none;
        pointer-events: none;
        transition: filter 0.2s ease, opacity 0.2s ease;
    }

    .blurred-price sup {
        font-size: 10px;
        margin-left: 2px;
        opacity: 0.5;
    }

    .blurred-price:hover {
        color: var(--text-strong);
    }

    .blurred-price:focus {
        outline: none;
        box-shadow: none;
    }

.addToCart-btn,
.wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--brand-plum);
    background-color: var(--surface);
    color: var(--brand-plum);
}

    .addToCart-btn:hover,
    .wishlist-btn:hover,
    .addToCart-btn.active,
    .wishlist-btn.active {
        background-color: var(--brand-plum);
        border-color: var(--brand-plum);
        color: var(--text-on-dark);
    }


/* 3. Forms ================================================================ */

.form-control,
.form-select,
.form-input {
    min-height: 44px;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    color: var(--text);
    background-color: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-0);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

    .form-control::placeholder,
    .form-input::placeholder {
        color: var(--text-muted);
        opacity: 1;
    }

    .form-control:focus,
    .form-select:focus,
    .form-input:focus {
        color: var(--text);
        border-color: var(--brand-plum);
        outline: none;
        box-shadow: var(--ring);
    }

    .form-control.is-invalid,
    .form-select.is-invalid,
    .form-input.is-invalid,
    .input-validation-error {
        border-color: var(--danger);
    }

textarea.form-control,
textarea.form-input {
    min-height: 88px;
}

/* Size/colour of labels stay with the page/modal styles for now. */
.form-label {
    font-weight: var(--fw-medium);
}

.field-validation-error,
.invalid-feedback {
    font-size: var(--fs-xs);
    color: var(--danger);
}

.form-check-input {
    accent-color: var(--brand-plum);
}

    .form-check-input:checked {
        background-color: var(--brand-plum);
        border-color: var(--brand-plum);
    }

    .form-check-input:focus {
        border-color: var(--brand-plum);
        box-shadow: var(--ring);
    }

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--brand-plum);
}


/* 4. Breadcrumb ===========================================================
   Replaces the global `.breadcrumb` rules that used to leak from
   orderHistory.css. Works with Bootstrap items (.breadcrumb-item) and with
   the plain-text variants (`Home > Cart`, `.breadcrumb-sep`). */

.breadcrumb {
    --bs-breadcrumb-divider: '›';
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

    .breadcrumb a {
        color: var(--text-muted);
        text-decoration: none;
    }

        .breadcrumb a:hover {
            color: var(--brand-plum);
        }

    /* kept at Bootstrap's specificity so page stylesheets (blog) can override */
    .breadcrumb-item + .breadcrumb-item::before {
        color: var(--line-strong);
    }

    .breadcrumb-item.active,
    .breadcrumb [aria-current="page"] {
        color: var(--text-strong);
    }

.breadcrumb-sep {
    margin: 0 var(--space-2);
    color: var(--line-strong);
}


/* 5. Section header ====================================================== */

.section-y {
    padding-block: var(--section-y);
}

.section-head {
    text-align: center;
    margin: 0 auto var(--space-6);
}

.eyebrow {
    display: block;
    margin-bottom: var(--space-3);
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--brand-gold);
}

.section-title {
    font-family: var(--font-serif);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-medium);
    line-height: var(--lh-tight);
    color: var(--brand-plum);
}

.section-sub {
    max-width: 62ch;
    margin: var(--space-3) auto 0;
    color: var(--text-muted);
}


/* 6. Card ================================================================ */

.card-brand {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur) var(--ease);
}

    .card-brand:hover {
        box-shadow: var(--shadow);
    }


/* 7. Badges ============================================================== */

.badge-brand,
.badge-gold,
.badge-success,
.badge-danger {
    display: inline-block;
    padding: 3px 10px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    line-height: 1.5;
    letter-spacing: .04em;
    white-space: nowrap;
    border-radius: var(--radius-pill);
    color: var(--brand-plum);
    background: var(--brand-plum-tint);
}

.badge-gold {
    color: var(--brand-plum-deep);
    background: var(--brand-gold-light);
}

.badge-success {
    color: var(--success);
    background: var(--success-bg);
}

.badge-danger {
    color: var(--danger);
    background: var(--danger-bg);
}


/* 8. Empty state ========================================================== */

.empty-state {
    text-align: center;
    padding: var(--space-8) var(--space-5);
    background: var(--surface-cream);
    border: 1px solid var(--line);
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-4);
    color: var(--text-muted);
}

    .empty-icon svg,
    .empty-icon img {
        width: 100%;
        height: 100%;
    }

.empty-title {
    font-family: var(--font-serif);
    font-size: var(--fs-lg);
    font-weight: var(--fw-medium);
    color: var(--brand-plum);
    margin-bottom: var(--space-2);
}

.empty-body {
    font-size: var(--fs-base);
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto var(--space-5);
}

.btn-explore {
    display: inline-block;
    min-height: 44px;
    background: var(--brand-plum);
    color: var(--line);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .2em;
    line-height: 1.5;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 32px;
    transition: background var(--dur) var(--ease);
}

    .btn-explore:hover {
        background: var(--brand-plum-deep);
        color: var(--line);
    }


/* 8b. Order note (cart items + product details) ==========================
   Markup: .order-note > button.order-note-toggle (+ .order-note-label/-icon,
   .toggle-icon) + .order-note-body (textarea + small). cart.js /
   product-details.js toggle .order-note.open. The body fills the width of
   whatever holds the note (the full card width in the cart). */

.order-note-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 40px; /* touch target */
    padding: 6px 14px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: .02em;
    color: var(--brand-plum);
    background: var(--surface-sand);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

    .order-note-toggle:hover {
        background: var(--brand-plum-tint);
        border-color: var(--line-strong);
    }

    .order-note-toggle .order-note-label {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    /* pencil line icon (replaces the 📝 emoji, which rendered differently per platform) */
    .order-note-toggle .order-note-icon {
        flex: none;
        width: 14px;
        height: 14px;
    }

.toggle-icon {
    font-size: 14px;
    font-weight: var(--fw-semibold);
    line-height: 1;
    transition: transform .25s var(--ease);
}

.order-note.open .toggle-icon {
    transform: rotate(45deg);
}

.order-note-body {
    display: none;
    margin-top: var(--space-2);
}

.order-note.open .order-note-body {
    display: block;
}

    .order-note-body textarea {
        display: block;
        width: 100%;
        min-height: 84px;
        resize: vertical;
    }

    .order-note-body small {
        display: block;
        margin-top: var(--space-1);
        font-size: var(--fs-xs);
    }

@media (prefers-reduced-motion: reduce) {
    .toggle-icon {
        transition: none;
    }
}


/* 9. Alerts (Bootstrap, re-coloured) ====================================== */

.alert {
    border-radius: var(--radius-sm);
    border-color: var(--line);
}

.alert-success {
    color: var(--success);
    background-color: var(--success-bg);
}

.alert-danger {
    color: var(--danger);
    background-color: var(--danger-bg);
}

.alert-warning {
    color: var(--warning);
    background-color: var(--warning-bg);
}

.alert-info,
.alert-primary {
    color: var(--brand-plum);
    background-color: var(--brand-plum-tint);
}

.alert-secondary,
.alert-light {
    color: var(--text);
    background-color: var(--surface-sand);
}


/* 10. Modal =============================================================== */

.modal-content {
    border-radius: var(--radius);
}

.modal-title {
    font-family: var(--font-serif);
}

.modal-header .btn-close {
    box-sizing: content-box;
    width: 16px;
    height: 16px;
    padding: 12px; /* 40px hit area */
    background-size: 14px;
}

    .modal-header .btn-close:focus {
        box-shadow: none;
    }

    .modal-header .btn-close:focus-visible {
        box-shadow: var(--ring);
    }


/* 11. SweetAlert theme (swal.js customClass) ============================== */

.jewel-swal {
    background: linear-gradient(135deg, var(--brand-plum-deep), var(--brand-plum-soft));
    color: var(--text-on-dark);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, .2);
    font-family: var(--font-sans);
}

    .jewel-swal .swal2-title {
        color: var(--text-on-dark);
        font-family: var(--font-serif);
        font-weight: var(--fw-semibold);
        letter-spacing: .5px;
    }

    .jewel-swal .swal2-html-container {
        color: var(--text-on-dark);
        opacity: .9;
    }

.jewel-confirm-btn {
    background: linear-gradient(135deg, var(--brand-gold), var(--brand-gold-light));
    color: var(--brand-plum-deep);
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-weight: var(--fw-semibold);
    margin: 5px;
}

.jewel-cancel-btn {
    background: transparent;
    border: 1px solid var(--text-on-dark);
    color: var(--text-on-dark);
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    margin: 5px;
}

.jewel-confirm-btn:focus-visible,
.jewel-cancel-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.jewel-toast {
    background: var(--brand-plum);
    color: var(--text-on-dark);
}


/* 12. Pagination (Bootstrap .pagination and the blog pager) =============== */

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-3);
    font-size: var(--fs-sm);
    color: var(--brand-plum);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-0);
}

    .pagination .page-link:hover {
        color: var(--brand-plum);
        background: var(--surface-sand);
        border-color: var(--line-strong);
    }

    .pagination .page-link:focus {
        box-shadow: var(--ring);
    }

.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    border-radius: var(--radius-0);
}

.pagination .page-item.active .page-link {
    color: var(--text-on-dark);
    background: var(--brand-plum);
    border-color: var(--brand-plum);
}

.pagination .page-item.disabled .page-link {
    color: var(--line-strong);
    background: var(--surface);
}


/* 13. Reveal ==============================================================
   Content is only hidden when the inline head script has added
   `js-reveal` to <html>, so it stays visible without JavaScript. */

html.js-reveal .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s var(--ease), transform .6s var(--ease);
}

    html.js-reveal .reveal.visible {
        opacity: 1;
        transform: none;
    }

@media (prefers-reduced-motion: reduce) {
    html.js-reveal .reveal,
    html.js-reveal .reveal.visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
}


/* 14. Utilities =========================================================== */

.text-plum {
    color: var(--brand-plum);
}

.text-gold {
    color: var(--brand-gold);
}

.text-muted-brand {
    color: var(--text-muted);
}

.bg-cream {
    background-color: var(--surface-cream);
}

.bg-sand {
    background-color: var(--surface-sand);
}

.bg-plum {
    background-color: var(--brand-plum);
    color: var(--text-on-dark);
}

.container-brand {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 16px;
}

@media (min-width: 576px) {
    .container-brand {
        padding-inline: 24px;
    }
}
