/* ==========================================================================
   Ayuvani — the customer's account pages
   Added 2026-11-13.
   --------------------------------------------------------------------------
   Profile, orders, addresses, wishlist, tickets, coupons, restock requests:
   everything behind "My Account" on the storefront. The admin and vendor
   panels were brought onto the clay surfaces in dashboard.css; this is the
   same treatment for the third dashboard, so a customer looking at their
   orders and a vendor looking at the same orders see one product.

   WHY IT IS SCOPED THE WAY IT IS

   These pages sit inside the storefront layout, which is shared with the
   catalogue, the cart and checkout. `.card`, `.form-control` and `.btn`
   appear on every one of those, so restyling them globally from here would
   redesign the shop by accident.

   `body:has(.__customer-sidebar)` is the scope. That sidebar is included by
   the account pages and by nothing else, so the rules reach exactly the
   screens they are written for. A browser without :has() support gets the
   theme's own look on these pages, unchanged and complete — the cost of
   missing this file is cosmetic, never structural.

   The sidebar's own rules are not scoped, since `.__customer-sidebar` is
   already unique to these pages.
   ========================================================================== */

body:has(.__customer-sidebar) {
    --ayv-forest: #14301a;
    --ayv-leaf: #2f6b2c;
    --ayv-leaf-light: #3f8a3b;
    --ayv-accent: #d4bf35;

    --ayv-canvas: #f2f1e8;
    --ayv-tile-line: rgba(20, 48, 26, 0.07);
    --ayv-field: #f4f2e9;
    --ayv-field-shade: #dcd8c9;
    --ayv-field-lit: #ffffff;

    --ayv-ink: #16301c;
    --ayv-ink-soft: rgba(22, 48, 28, 0.62);
    --ayv-ink-faint: rgba(22, 48, 28, 0.38);
}

/* --------------------------------------------------------------------------
   1. THE CANVAS
   The storefront is white, so without this the tiles would be white on
   white and the whole treatment would do nothing.
   -------------------------------------------------------------------------- */

/* On the body, not on <main>.

   The first version of this rule targeted `main, .main-content`. Neither
   element exists on these pages: the account content is
   `section.__customer-profile` inside `div.container.user-profile-container`,
   with no <main> anywhere in the document. The rule therefore matched
   nothing, the canvas never appeared, and the tiles would have been white
   on white — the same failure the vendor panel had, found the same way, by
   opening the page and reading it rather than trusting the markup I
   expected.

   The body is safe to tint here because the storefront header and footer
   both paint their own grounds, so this shows only in the content band. */
body:has(.__customer-sidebar) {
    background-color: var(--ayv-canvas);
    background-image:
        radial-gradient(46rem 28rem at 88% 6%, rgba(255, 246, 198, 0.40) 0%, rgba(255, 246, 198, 0) 60%),
        radial-gradient(40rem 26rem at 2% 96%, rgba(143, 176, 137, 0.18) 0%, rgba(143, 176, 137, 0) 64%);
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   2. THE SIDEBAR
   A tile of its own, with the active item marked rather than merely tinted.
   -------------------------------------------------------------------------- */

.__customer-sidebar {
    padding: 0.85rem;
    border-radius: 20px;
    background: linear-gradient(158deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
    border: 1px solid var(--ayv-tile-line);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 18px 38px -26px rgba(20, 48, 26, 0.42);
}

.__customer-sidebar .widget-title a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    position: relative;

    padding: 0.62rem 0.8rem;
    border-radius: 12px;
    color: var(--ayv-ink-soft);
    font-weight: 500;
    text-decoration: none;
    transition: background-color 140ms ease, color 140ms ease;
}

.__customer-sidebar .widget-title a svg {
    flex: 0 0 auto;
    color: var(--ayv-ink-faint);
    transition: color 140ms ease;
}

.__customer-sidebar .widget-title a:hover {
    background-color: rgba(47, 107, 44, 0.07);
    color: var(--ayv-forest);
}

.__customer-sidebar .widget-title a:hover svg {
    color: var(--ayv-leaf);
}

.__customer-sidebar .widget-title a.active-menu {
    background-color: rgba(47, 107, 44, 0.10);
    color: var(--ayv-forest);
    font-weight: 600;
}

.__customer-sidebar .widget-title a.active-menu svg {
    color: var(--ayv-leaf);
}

/* The marker. The theme distinguishes the current page by a tint alone,
   which on a ten-item list is easy to miss at a glance. */
.__customer-sidebar .widget-title a.active-menu::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.15rem;
    border-radius: 3px;
    background: var(--ayv-accent);
}

.__customer-sidebar .aside-link {
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   3. TILES
   -------------------------------------------------------------------------- */

.__customer-profile .card,
.__customer-profile .__card,
.user-profile-container .col-lg-9 .card {
    background: linear-gradient(158deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
    border: 1px solid var(--ayv-tile-line);
    border-radius: 20px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 18px 38px -26px rgba(20, 48, 26, 0.42);
}

.__customer-profile .card-header,
.__customer-profile .card-footer {
    background: transparent;
    border-color: var(--ayv-tile-line);
}

.__customer-profile .card-header h1,
.__customer-profile .card-header h2,
.__customer-profile .card-header h3,
.__customer-profile .card-header h4,
.__customer-profile .card-header h5 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ayv-ink-soft);
    margin-bottom: 0;
}

/* A card inside a card becomes a recess rather than a second tile. */
.__customer-profile .card .card,
.__customer-profile .card-inner {
    background: rgba(255, 255, 255, 0.55);
    border: 0;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px var(--ayv-tile-line);
}

/* --------------------------------------------------------------------------
   4. LISTS
   The orders table, same strips as the panels.
   -------------------------------------------------------------------------- */

body:has(.__customer-sidebar) .table {
    --bs-table-bg: transparent;
    border-color: transparent;
    color: var(--ayv-ink);
}

body:has(.__customer-sidebar) .table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-width: 0;
}

body:has(.__customer-sidebar) .table > thead th {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ayv-ink-faint);
    border-bottom: 1px solid var(--ayv-tile-line);
}

@media (min-width: 768px) {

    body:has(.__customer-sidebar) .table {
        border-collapse: separate;
        border-spacing: 0 0.4rem;
    }

    body:has(.__customer-sidebar) .table > tbody > tr {
        background: rgba(255, 255, 255, 0.72);
        box-shadow: inset 0 0 0 1px rgba(20, 48, 26, 0.05);
        transition: background-color 140ms ease, box-shadow 140ms ease;
    }

    body:has(.__customer-sidebar) .table > tbody > tr:hover {
        background: #fff;
        box-shadow:
            inset 0 0 0 1px rgba(20, 48, 26, 0.09),
            0 6px 14px -8px rgba(20, 48, 26, 0.26);
    }

    body:has(.__customer-sidebar) .table > tbody > tr > td:first-child {
        border-start-start-radius: 12px;
        border-end-start-radius: 12px;
    }

    body:has(.__customer-sidebar) .table > tbody > tr > td:last-child {
        border-start-end-radius: 12px;
        border-end-end-radius: 12px;
    }
}

body:has(.__customer-sidebar) .table > tbody > tr > td {
    padding-block: 0.8rem;
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
   5. FIELDS AND BUTTONS
   The same controls as the panels and the sign-in pages.
   -------------------------------------------------------------------------- */

body:has(.__customer-sidebar) .form-control,
body:has(.__customer-sidebar) .form-select {
    border: 0;
    border-radius: 12px;
    background-color: var(--ayv-field);
    color: var(--ayv-ink);
    box-shadow:
        inset 2px 2px 5px var(--ayv-field-shade),
        inset -2px -2px 5px var(--ayv-field-lit);
    transition: box-shadow 160ms ease;
}

body:has(.__customer-sidebar) .form-control::placeholder {
    color: var(--ayv-ink-faint);
}

body:has(.__customer-sidebar) .form-control:focus,
body:has(.__customer-sidebar) .form-select:focus {
    background-color: var(--ayv-field);
    box-shadow:
        inset 2px 2px 5px var(--ayv-field-shade),
        inset -2px -2px 5px var(--ayv-field-lit),
        0 0 0 2px var(--ayv-accent);
}

body:has(.__customer-sidebar) label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ayv-ink-soft);
}

body:has(.__customer-sidebar) .btn {
    border-radius: 12px;
    font-weight: 600;
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

body:has(.__customer-sidebar) .btn--primary,
body:has(.__customer-sidebar) .btn-primary {
    border: 0;
    color: #fff;
    background: linear-gradient(145deg, var(--ayv-leaf-light) 0%, var(--ayv-forest) 100%);
    box-shadow:
        0 8px 18px -8px rgba(20, 48, 26, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

body:has(.__customer-sidebar) .btn--primary:hover,
body:has(.__customer-sidebar) .btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

body:has(.__customer-sidebar) .btn--primary:active,
body:has(.__customer-sidebar) .btn-primary:active {
    transform: translateY(1px);
    box-shadow:
        0 3px 8px -4px rgba(20, 48, 26, 0.5),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body:has(.__customer-sidebar) .badge {
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font-weight: 600;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 2px 6px -3px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   6. ARRIVAL
   -------------------------------------------------------------------------- */

@keyframes ayv-account-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {

    .__customer-profile {
        animation: ayv-account-in 340ms cubic-bezier(0.22, 1, 0.36, 1) 60ms backwards;
    }

    .__customer-sidebar {
        animation: ayv-account-in 340ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
    }
}

/* --------------------------------------------------------------------------
   7. PHONE
   The sidebar slides in as a panel below 992px, so it keeps its own
   treatment but loses the tile shadow, which would sit on the overlay.
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {

    .__customer-sidebar {
        border-radius: 0;
        box-shadow: none;
        border: 0;
    }

    .__customer-profile .card,
    .__customer-profile .__card {
        border-radius: 16px;
    }
}
