/* =====================================================================
   YOUNICCAFE — CORE STYLESHEET
   Design direction: a roastery at dusk. Deep espresso and warm brass,
   not the cliché cream-and-terracotta cafe palette. Editorial product
   grid (hairline rules, no stacked drop-shadows) rather than generic
   SaaS cards. One orchestrated hero moment; everything else answers
   the user's own actions (hover, open, add).
   ===================================================================== */

:root {
    /* ---- Brand palette (admin-editable via Settings) ---- */
    --primary:      #4A2C1D;   /* deep roasted espresso */
    --primary-dark: #2E1B11;
    --secondary:    #C89B6A;   /* warm caramel / latte */
    --accent:       #E08A3D;   /* toasted marigold gold */
    --accent-dark:  #BE7429;
    --dark:         #1C120B;   /* near-black roast, for dark sections */
    --light:        #FFFDF9;   /* warm white */
    --cream:        #F3E9DA;   /* card / section backdrop */
    --border:       #E4D3BB;
    --charcoal:     #2B211A;   /* body text */
    --muted:        #7A6A5A;
    --success:      #4C7A4C;
    --danger:       #B3483F;

    /* ---- Type ---- */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* ---- Layout ---- */
    --container-max: 1320px;
    --radius-sm: 6px;
    --radius-md: 14px;
    --radius-lg: 28px;
    --header-h: 88px;
    --header-h-scrolled: 68px;

    /* ---- Motion ---- */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dur-fast: 180ms;
    --dur-med: 420ms;
    --dur-slow: 800ms;
}

/* =====================================================================
   RESET
   ===================================================================== */

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--charcoal);
    background: var(--light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; margin: 0; padding: 0; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--dark);
    margin: 0;
    line-height: 1.15;
    font-weight: 600;
}

p { margin: 0; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* =====================================================================
   LAYOUT UTILITIES
   ===================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 24px;
}

.section { padding-block: clamp(56px, 8vw, 104px); }
.section--dark { background: var(--dark); color: var(--cream); }
.section--dark h2, .section--dark h3 { color: var(--light); }
.section--cream { background: var(--cream); }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head h2 {
    font-size: clamp(28px, 3.4vw, 42px);
    max-width: 34ch;
}

.section-head p {
    color: var(--muted);
    max-width: 46ch;
    margin-top: 10px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1.5px solid var(--accent);
    padding-bottom: 2px;
    transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
    white-space: nowrap;
}
.text-link:hover { color: var(--accent-dark); }

/* =====================================================================
   BUTTONS
   ===================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.01em;
    transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--accent); color: var(--dark); }
.btn--primary:hover { background: var(--accent-dark); box-shadow: 0 10px 24px -8px rgba(224, 138, 61, 0.55); }

.btn--outline { background: transparent; border-color: currentColor; color: var(--light); }
.btn--outline:hover { background: rgba(255,255,255,0.1); }

.btn--dark { background: var(--dark); color: var(--light); }
.btn--dark:hover { background: var(--primary-dark); }

.btn--sm { padding: 10px 20px; font-size: 13px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    position: relative;
    transition: background var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: rgba(0,0,0,0.05); }
.icon-btn svg { width: 21px; height: 21px; stroke: currentColor; }

.icon-btn__badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--dark);
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* =====================================================================
   SITE HEADER
   ===================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 253, 249, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: height var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease), border-color var(--dur-med) var(--ease);
}

.site-header .container {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    transition: height var(--dur-med) var(--ease);
}

.site-header.is-scrolled {
    box-shadow: 0 8px 28px -14px rgba(28, 18, 11, 0.25);
    border-bottom-color: var(--border);
}
.site-header.is-scrolled .container { height: var(--header-h-scrolled); }

.site-logo {
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.01em;
    flex-shrink: 0;
}
.site-logo span { color: var(--accent); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav > li { position: relative; }

.main-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 15px;
    color: var(--charcoal);
    border-radius: 100px;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.main-nav a:hover, .main-nav li.is-open > a { background: var(--cream); color: var(--primary); }

.mega-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 620px;
    background: var(--light);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 60px -20px rgba(28, 18, 11, 0.3);
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), visibility var(--dur-fast);
}
.main-nav li.is-open .mega-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.mega-menu a {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.header-actions { display: flex; align-items: center; gap: 2px; }

.header-actions .icon-btn { color: var(--primary); }

.mobile-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.mobile-menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.mobile-menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile slide-in nav */
.mobile-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(88vw, 380px);
    height: 100dvh;
    background: var(--light);
    z-index: 300;
    transform: translateX(100%);
    transition: transform var(--dur-med) var(--ease);
    overflow-y: auto;
    padding: 28px 24px;
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav a {
    display: block;
    padding: 15px 4px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    color: var(--charcoal);
}

.scrim {
    position: fixed;
    inset: 0;
    background: rgba(28, 18, 11, 0.5);
    z-index: 290;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-med) var(--ease), visibility var(--dur-med);
}
.scrim.is-visible { opacity: 1; visibility: visible; }

/* =====================================================================
   PRODUCT CARDS — editorial style: hairline rule, no stacked shadow kit
   ===================================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px 24px;
}

.product-card { position: relative; }

.product-card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--cream);
    margin-bottom: 16px;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--dur-slow) var(--ease), opacity var(--dur-med) var(--ease);
}
.product-card__media img.img--secondary {
    position: absolute;
    inset: 0;
    opacity: 0;
}
.product-card:hover .product-card__media img.img--primary { transform: scale(1.06); opacity: 0; }
.product-card:hover .product-card__media img.img--secondary { opacity: 1; transform: scale(1.06); }

.product-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--dark);
    color: var(--light);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}
.product-card__badge--sale { background: var(--accent); color: var(--dark); }

.product-card__wishlist {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 253, 249, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-6px);
    opacity: 0;
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.product-card:hover .product-card__wishlist { transform: translateY(0); opacity: 1; }
.product-card__wishlist svg { width: 18px; height: 18px; stroke: var(--primary); }
.product-card__wishlist.is-active svg { fill: var(--danger); stroke: var(--danger); }

.product-card__actions {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 8px;
    transform: translateY(10px);
    opacity: 0;
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.product-card:hover .product-card__actions { transform: translateY(0); opacity: 1; }

.product-card__category {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    display: block;
}

.product-card__title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 6px;
}

.product-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card__price { display: flex; align-items: baseline; gap: 8px; }
.product-card__price .current { font-weight: 700; font-size: 17px; color: var(--primary); }
.product-card__price .original { font-size: 13px; color: var(--muted); text-decoration: line-through; }

.product-card__rating { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.product-card__rating svg { width: 13px; height: 13px; fill: var(--accent); stroke: none; }

/* =====================================================================
   CATEGORY CIRCLES
   ===================================================================== */

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
}

.category-item { text-align: center; }

.category-item__img {
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--cream);
    margin-bottom: 14px;
    position: relative;
    border: 1.5px solid var(--border);
    transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.category-item__img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-med) var(--ease); }
.category-item:hover .category-item__img { border-color: var(--accent); transform: translateY(-4px); }
.category-item:hover .category-item__img img { transform: scale(1.08); }

.category-item__name { font-weight: 600; font-size: 15px; color: var(--dark); }
.category-item__count { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* =====================================================================
   FOOTER
   ===================================================================== */

.site-footer { background: var(--dark); color: var(--cream); padding-top: 72px; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1.3fr;
    gap: 40px;
    padding-bottom: 56px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-grid h4 {
    color: var(--light);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 18px;
}

.footer-grid a, .footer-grid p { color: rgba(243, 233, 218, 0.72); font-size: 14.5px; }
.footer-grid li { margin-bottom: 11px; }
.footer-grid a:hover { color: var(--accent); }

.footer-brand .site-logo { color: var(--light); margin-bottom: 14px; }
.footer-brand .site-logo span { color: var(--accent); }
.footer-brand p { max-width: 32ch; line-height: 1.7; }

.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--dur-fast) var(--ease);
}
.footer-social a:hover { background: var(--accent); }
.footer-social svg { width: 17px; height: 17px; stroke: var(--light); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 26px;
    font-size: 13.5px;
    color: rgba(243, 233, 218, 0.55);
}

.newsletter-form {
    display: flex;
    gap: 0;
    margin-top: 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 100px;
    padding: 4px;
    max-width: 340px;
}
.newsletter-form input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    color: var(--light);
}
.newsletter-form input::placeholder { color: rgba(243,233,218,0.5); }
.newsletter-form button { flex-shrink: 0; }

/* =====================================================================
   TOAST / MINI-CART / MODALS (structure — behaviour wired in main.js)
   ===================================================================== */

.toast-stack {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.toast {
    background: var(--dark);
    color: var(--light);
    padding: 13px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 14px 34px -12px rgba(0,0,0,0.4);
}
.toast svg { width: 16px; height: 16px; stroke: var(--accent); }

.cart-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(92vw, 420px);
    height: 100dvh;
    background: var(--light);
    z-index: 400;
    transform: translateX(100%);
    transition: transform var(--dur-med) var(--ease);
    display: flex;
    flex-direction: column;
}
.cart-drawer.is-open { transform: translateX(0); }

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 18, 11, 0.92);
    z-index: 350;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-med) var(--ease), visibility var(--dur-med);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12vh;
}
.search-overlay.is-open { opacity: 1; visibility: visible; }
.search-overlay input {
    width: min(640px, 88vw);
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--accent);
    color: var(--light);
    font-family: var(--font-display);
    font-size: clamp(24px, 4vw, 40px);
    padding: 12px 4px;
    text-align: center;
}
.search-overlay input::placeholder { color: rgba(255,253,249,0.4); }

/* Skeleton loading state for AJAX product loading */
.skeleton {
    background: linear-gradient(100deg, var(--cream) 30%, #ebe0ce 50%, var(--cream) 70%);
    background-size: 200% 100%;
    animation: skeleton-sweep 1.4s ease-in-out infinite;
    border-radius: var(--radius-md);
}
