/* =========================================================================
   Fiore Shop — storefront styles
   Warm, artisan, Tuscan farm aesthetic.
   ========================================================================= */
:root {
    --honey: #E8920A;
    --amber: #C4640A;
    --gold: #F5C842;
    --cream: #FDF6E3;
    --forest: #4A7C59;
    --dark: #2C1A0E;
    --paper: #fffdf7;
    --line: #ece0c4;
    --shadow: 0 6px 24px rgba(44, 26, 14, 0.10);
    --radius: 12px;
    /* Font stacks — overridden per-site from the Appearance panel (base.html). */
    --font-head: 'Playfair Display', Georgia, serif;
    --font-body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--dark);
    background: var(--cream);
    line-height: 1.6;
    /* Sticky-footer shell: footer sits at the bottom of the viewport on short
       pages, and is pushed down naturally when content is taller than the screen. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Main content grows to fill the space, pushing the footer to the bottom. */
main { flex: 1 0 auto; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--dark); }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { width: min(1180px, 92%); margin: 0 auto; }
.section { padding: 3rem 0; }
.section.narrow { width: min(760px, 92%); }
.section-title { font-size: 1.9rem; margin: 0 0 1.5rem; text-align: center; }

/* ----------------------------------------------------------------- header */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; }
.brand { margin-right: auto; }
.main-nav { order: 2; }
.header-tools { order: 3; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; color: var(--dark); }
.brand-logo { height: 42px; width: auto; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.6rem; }
.main-nav { display: flex; align-items: center; gap: 1.6rem; }
.main-nav a { color: var(--dark); font-weight: 600; }
.cart-link { position: relative; }
.cart-count {
    background: var(--amber); color: #fff; border-radius: 999px;
    font-size: .72rem; padding: .1rem .45rem; margin-left: .15rem; font-weight: 700;
}
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; }

/* language switcher */
.header-tools { display: flex; align-items: center; gap: .6rem; }
.lang-switch { display: flex; gap: .15rem; margin: 0; }
.lang-flag { display: inline-flex; align-items: center; background: none; border: 0; padding: .15rem .25rem; font-size: 1.15rem; line-height: 1; cursor: pointer; border-radius: 6px; opacity: .55; filter: grayscale(60%); transition: .15s; text-decoration: none; }
.lang-flag:hover { opacity: 1; filter: none; text-decoration: none; }
.lang-flag.active { opacity: 1; filter: none; background: var(--gold); }

/* --------------------------------------------------------------- messages */
.messages { margin-top: 1rem; }
.message { padding: .8rem 1rem; border-radius: 8px; margin-bottom: .6rem; font-weight: 600; }
.message-success { background: #e6f4ea; color: #1e6b3a; }
.message-error, .message-danger { background: #fdecea; color: #b3261e; }
.message-info { background: #eaf2fb; color: #1e4e79; }
.message-warning { background: #fef6e0; color: #8a5a00; }

/* ------------------------------------------------------------------- hero */
.hero {
    background: linear-gradient(135deg, rgba(245,200,66,.25), rgba(232,146,10,.18)), var(--cream);
    padding: 4.5rem 0; text-align: center;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 1rem; }
.hero-tagline { font-size: 1.2rem; max-width: 620px; margin: 0 auto 1.8rem; color: #5a4632; }
/* Hero with a custom background photo: dark overlay (set inline) + light text. */
.hero.hero-photo h1, .hero.hero-photo .hero-tagline { color: #fff; }
.hero.hero-photo .hero-tagline { text-shadow: 0 1px 6px rgba(0,0,0,.35); }

/* ------------------------------------------------------------- categories */
.category-links { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.category-chip {
    background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
    padding: .55rem 1.3rem; color: var(--dark); font-weight: 600; transition: .15s;
}
.category-chip:hover { background: var(--gold); text-decoration: none; }

/* Category cards (homepage) — image + name, falling back to an emoji tile. */
.category-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.category-card {
    display: flex; flex-direction: column; align-items: stretch;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; color: var(--dark); font-weight: 700; text-align: center; transition: .15s;
}
.category-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.category-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.category-card-ph { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: linear-gradient(135deg, rgba(245,200,66,.3), rgba(232,146,10,.2)); font-size: 2.4rem; }
.category-card-name { padding: .7rem .6rem; }

/* ------------------------------------------------------------ product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
.product-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-card-image { position: relative; aspect-ratio: 1 / 1; background: #f6edd6; display: block; }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; }
.product-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: #f6edd6; }
.product-card-placeholder.large { aspect-ratio: 1/1; font-size: 6rem; border-radius: var(--radius); }
.product-card-placeholder.small { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 8px; }
.product-card-body { padding: 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.product-card-category { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--forest); font-weight: 700; }
.product-card-name { font-size: 1.05rem; margin: 0; }
.product-card-name a { color: var(--dark); }
.product-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.price { font-weight: 700; color: var(--amber); font-size: 1.1rem; }
.price-lg { font-size: 1.8rem; }
.badge-out { position: absolute; top: .6rem; left: .6rem; background: var(--dark); color: #fff; font-size: .7rem; padding: .2rem .55rem; border-radius: 6px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 8px; padding: .65rem 1.2rem; font-family: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; transition: .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: #a8550a; color: #fff; }
.btn-outline { background: transparent; color: var(--amber); border: 2px solid var(--amber); }
.btn-outline:hover { background: var(--amber); color: #fff; }
.btn-instagram { background: linear-gradient(45deg, #feda75 0%, #fa7e1e 22%, #d62976 52%, #962fbf 76%, #4f5bd5 100%); color: #fff; box-shadow: 0 4px 14px rgba(214,41,118,.35); }
.btn-instagram:hover { color: #fff; filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(214,41,118,.45); }
.btn-disabled { background: #d8cdb5; color: #fff; cursor: not-allowed; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------ story */
.story { background: var(--forest); color: #f3f7f1; }
.story-inner { padding: 3.5rem 0; text-align: center; max-width: 760px; }
.story h2 { color: #fff; }
.story p { font-size: 1.1rem; }
.story .btn-outline { color: #fff; border-color: #fff; }
.story .btn-outline:hover { background: #fff; color: var(--forest); }

/* ----------------------------------------------------------- shop listing */
.page-header { text-align: center; margin-bottom: 2rem; }
.page-header h1 { font-size: 2.2rem; margin: 0 0 .4rem; }
.shop-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.shop-sidebar h4 { margin: 0 0 .6rem; }
.category-filter { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }
.category-filter a { display: block; padding: .45rem .7rem; border-radius: 8px; color: var(--dark); font-weight: 600; }
.category-filter a:hover, .category-filter a.active { background: var(--gold); text-decoration: none; }
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; gap: 1rem; flex-wrap: wrap; }
.result-count { color: #6b5840; font-weight: 600; }
.sort-form { display: flex; align-items: center; gap: .5rem; }
.sort-form select { padding: .45rem .6rem; border-radius: 8px; border: 1px solid var(--line); font-family: inherit; }

/* ----------------------------------------------------------- product page */
.breadcrumb { font-size: .85rem; color: #6b5840; margin-bottom: 1.5rem; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.gallery-main { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #f6edd6; }
.gallery-main img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.gallery-thumb { width: 70px; height: 70px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; padding: 0; background: none; cursor: pointer; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info h1 { font-size: 2.2rem; margin: .3rem 0; }
.stock-indicator { font-weight: 700; }
.stock-indicator.in-stock { color: var(--forest); }
.stock-indicator.out-stock { color: #b3261e; }
.product-description { margin: 1.2rem 0; color: #4a3a28; }
.add-to-cart-row { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* qty selector */
.qty-selector { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--paper); }
.qty-btn { background: none; border: 0; width: 38px; height: 40px; font-size: 1.2rem; cursor: pointer; color: var(--dark); }
.qty-btn:hover { background: var(--gold); }
.qty-selector input { width: 50px; height: 40px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font-family: inherit; font-size: 1rem; }

/* ------------------------------------------------------------------- cart */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; }
.cart-table th { text-align: left; padding: .9rem 1rem; background: #f4ead0; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.cart-table td { padding: .9rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.cart-thumb img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.cart-summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; position: sticky; top: 90px; }
.cart-summary h3 { margin-top: 0; }
.summary-row { display: flex; justify-content: space-between; margin: .6rem 0; }
.summary-note { font-size: .82rem; color: #6b5840; margin: .4rem 0 1rem; }
.link-danger { background: none; border: 0; color: #b3261e; font-size: 1.1rem; cursor: pointer; }
.empty-state { text-align: center; color: #6b5840; padding: 2rem 0; }

/* --------------------------------------------------------------- checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.form-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.4rem; background: var(--paper); }
.form-card legend { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 600; padding: 0 .5rem; }
.form-row { margin-bottom: 1rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.checkout-layout label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 1rem; }
.checkout-layout input, .checkout-layout select, .checkout-layout textarea {
    width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px;
    font-family: inherit; font-size: 1rem; margin-top: .3rem; background: #fff;
}
.shipping-option { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .8rem; border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; margin-bottom: .6rem; cursor: pointer; }
.shipping-option:has(input:checked) { border-color: var(--amber); background: #fdf2e2; }
.shipping-name { font-weight: 700; }
.shipping-days { color: #6b5840; font-size: .85rem; }
.shipping-price { font-weight: 700; color: var(--amber); }
.checkout-summary { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; position: sticky; top: 90px; }
.summary-items { list-style: none; margin: 0 0 1rem; padding: 0; }
.summary-items li { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.summary-qty { color: var(--amber); font-weight: 700; }
.summary-total { font-size: 1.25rem; font-weight: 700; border-top: 2px solid var(--line); padding-top: .6rem; margin-top: .4rem; }
.secure-note { text-align: center; font-size: .82rem; color: #6b5840; margin: .8rem 0 0; }
#payment-element { margin-top: .5rem; }
.form-error { color: #b3261e; font-weight: 600; margin-top: .6rem; }
.form-hint { color: #6b5840; font-size: .85rem; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------- order confirmation */
.confirmation-hero { text-align: center; margin-bottom: 2.5rem; }
.confirmation-check { width: 72px; height: 72px; border-radius: 50%; background: var(--forest); color: #fff; font-size: 2.4rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.lead { font-size: 1.15rem; }
.order-summary-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.order-items-table { width: 100%; border-collapse: collapse; }
.order-items-table td { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.order-items-table tfoot td { border-bottom: 0; padding-top: .6rem; }
.order-items-table .total-row td { font-weight: 700; font-size: 1.15rem; border-top: 2px solid var(--line); }
.text-right { text-align: right; }
.order-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.confirmation-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

/* --------------------------------------------------------- order tracking */
.tracking-form label { display: block; font-weight: 600; margin-bottom: 1rem; }
.tracking-form input { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 8px; margin-top: .3rem; font-family: inherit; font-size: 1rem; }
.tracking-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.muted { color: #6b5840; font-size: .85rem; }
.status-progress { list-style: none; display: flex; padding: 0; margin: 1.5rem 0; counter-reset: step; }
.status-progress li { flex: 1; text-align: center; position: relative; color: #a89881; }
.status-progress li .status-dot { width: 22px; height: 22px; border-radius: 50%; background: #e3d6ba; margin: 0 auto .5rem; display: block; border: 3px solid var(--cream); position: relative; z-index: 2; }
.status-progress li::before { content: ''; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: #e3d6ba; z-index: 1; }
.status-progress li:first-child::before { display: none; }
.status-progress li.done .status-dot, .status-progress li.current .status-dot { background: var(--forest); }
.status-progress li.done::before { background: var(--forest); }
.status-progress li.done, .status-progress li.current { color: var(--dark); font-weight: 700; }
.status-progress li.current .status-dot { box-shadow: 0 0 0 4px rgba(74,124,89,.25); }
.status-banner { padding: 1rem; border-radius: 8px; margin: 1.5rem 0; text-align: center; }
.status-banner.status-cancelled { background: #fdecea; color: #b3261e; }
.status-banner.status-refunded { background: #eef0f2; color: #555; }
.status-banner.status-pending { background: #fef6e0; color: #8a5a00; }
.tracking-number-box { background: #f4ead0; padding: .8rem 1rem; border-radius: 8px; margin: 1rem 0; }

/* ----------------------------------------------------------------- footer */
.site-footer { background: var(--dark); color: #e9ddc7; margin-top: 3rem; flex-shrink: 0; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.site-footer h3, .site-footer h4 { color: #fff; margin: 0 0 .6rem; }
.site-footer a { color: var(--gold); display: block; margin-bottom: .3rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 1rem 0; font-size: .85rem; color: #b8a98e; display: flex; align-items: center; justify-content: space-between; gap: .6rem 1.2rem; flex-wrap: wrap; }
.footer-bottom p { margin: 0; }
.footer-credit { display: inline-flex; align-items: center; gap: .45rem; }
.footer-credit a { display: inline-flex; align-items: center; gap: .35rem; color: #fff; font-weight: 700; letter-spacing: .03em; }
.footer-credit a:hover { color: var(--gold); opacity: .9; text-decoration: none; }
.yit-logo { height: 20px; width: auto; display: block; }

/* ------------------------------------------------------------------ toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%); background: var(--dark); color: #fff; padding: .8rem 1.4rem; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: .3s; z-index: 200; font-weight: 600; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-error { background: #b3261e; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); flex-direction: column; padding: 1rem; gap: .8rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
    body.nav-open .main-nav { display: flex; }
    .main-nav a { padding: .5rem 0; font-size: 1.05rem; }
    .product-detail, .cart-layout, .checkout-layout, .shop-layout, .order-meta, .footer-inner { grid-template-columns: 1fr; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .cart-summary, .checkout-summary { position: static; }
    .shop-sidebar { margin-bottom: 1rem; }
    .category-filter { flex-direction: row; flex-wrap: wrap; gap: .4rem; }
    .hero { padding: 3rem 0; }
    .section { padding: 2rem 0; }
}

/* Phones: turn the cart table into stacked cards, reflow shipping options. */
@media (max-width: 680px) {
    .cart-table thead { display: none; }
    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td { display: block; }
    .cart-table tr { position: relative; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; padding: .9rem 1rem .9rem 86px; min-height: 84px; }
    .cart-table td { border-top: 0; padding: .15rem 0; }
    .cart-thumb { position: absolute; left: 1rem; top: 1rem; padding: 0; }
    .cart-thumb img, .cart-thumb .product-card-placeholder { width: 60px; height: 60px; }
    .cart-table td.line-total { font-weight: 700; color: var(--amber); margin-top: .3rem; }
    .cart-remove { position: absolute; right: .7rem; top: .5rem; font-size: 1.3rem; padding: .2rem; }
    .cart-table .qty-selector { margin-top: .3rem; }

    .shipping-option { grid-template-columns: auto 1fr auto; row-gap: .2rem; }
    .shipping-days { grid-column: 2 / 4; font-size: .8rem; color: #6b5840; }

    .confirmation-actions { flex-direction: column; }
    .confirmation-actions .btn { width: 100%; }
}

/* Small phones: tighten the header so brand + flags + menu fit one row. */
@media (max-width: 560px) {
    .header-inner { gap: .5rem; }
    .brand-name { font-size: 1rem; }
    .brand-mark { font-size: 1.3rem; }
    .lang-flag { font-size: 1.15rem; padding: .25rem .18rem; }
    .header-tools { gap: .3rem; }
    .hero h1 { font-size: 2rem; }
    .section-title { font-size: 1.5rem; }
}
