/* ===========================================================
   ZOMA Garden — Portale B2B
   Palette ispirata al sito ufficiale (azzurro ZOMA)
   =========================================================== */

:root {
    --zoma-blue:      #29abe2;
    --zoma-blue-dark: #1f93c4;
    --zoma-blue-soft: #e8f6fc;
    --ink:            #20303a;
    --muted:          #6b7785;
    --line:           #e6eaee;
    --bg:             #ffffff;
    --bg-alt:         #f6f8fa;
    --ok:             #2faa55;
    --warn:           #e0a225;
    --danger:         #d9534f;
    --radius:         14px;
    --shadow:         0 6px 24px rgba(32, 48, 58, .08);
    --maxw:           1180px;
    --font:           'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--zoma-blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Top bar ---------- */
.topbar {
    background: var(--zoma-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .2px;
}
.topbar .wrap {
    display: flex;
    gap: 26px;
    align-items: center;
    height: 42px;
}
.topbar a { color: #fff; }

/* ---------- Header / nav ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 92px;
    gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo-img { height: 56px; width: auto; display: block; }
.brand .logo-img.logo-img-lg { height: 104px; }
.brand .logo-mark {
    width: 42px; height: 42px;
    display: grid; place-items: center;
}
.brand .logo-mark svg { width: 38px; height: 38px; }
.brand .logo-text { line-height: 1; }
.brand .logo-text strong {
    font-size: 30px; font-weight: 800; letter-spacing: 1px; color: var(--ink);
    display: block;
}
.brand .logo-text span {
    font-size: 10px; letter-spacing: 5px; color: var(--muted); font-weight: 600;
    padding-left: 2px;
}

.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav a {
    color: var(--ink);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active {
    color: var(--zoma-blue);
    border-bottom-color: var(--zoma-blue);
}

.header-actions { display: flex; align-items: center; gap: 14px; }
.user-chip { font-size: 13px; color: var(--muted); font-weight: 600; }
.cart-btn {
    position: relative;
    width: 46px; height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid; place-items: center;
    background: #fff;
}
.cart-btn .badge {
    position: absolute; top: -8px; right: -8px;
    background: var(--zoma-blue); color: #fff;
    font-size: 11px; font-weight: 700;
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 999px; display: grid; place-items: center;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font);
    font-weight: 700; font-size: 14px;
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, opacity .15s;
    text-decoration: none;
}
.btn-primary { background: var(--zoma-blue); color: #fff; }
.btn-primary:hover { background: var(--zoma-blue-dark); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--zoma-blue); color: var(--zoma-blue); text-decoration: none; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Page heading ---------- */
.page-head {
    display: flex; align-items: baseline; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin: 34px 0 22px;
}
.page-head h1 { font-size: 26px; margin: 0; font-weight: 800; }
.page-head .count { color: var(--muted); font-weight: 700; }

/* ---------- Flash ---------- */
.flash { padding: 14px 18px; border-radius: 10px; margin: 16px 0; font-weight: 600; }
.flash.success { background: #e7f6ec; color: #1c7a3c; }
.flash.error   { background: #fbe9e8; color: #b23b37; }
.flash.info    { background: var(--zoma-blue-soft); color: var(--zoma-blue-dark); }

/* ---------- Product grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    margin-bottom: 50px;
}
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: #fff;
    display: flex; flex-direction: column;
    position: relative;
    transition: box-shadow .18s, transform .18s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .thumb {
    aspect-ratio: 1 / 1;
    display: grid; place-items: center;
    margin-bottom: 16px;
    background: var(--bg-alt);
    border-radius: 10px;
    overflow: hidden;
}
.card .thumb img { max-height: 88%; width: auto; object-fit: contain; }
.card .thumb .noimg { color: var(--muted); font-size: 13px; }
.card h3 { font-size: 16px; margin: 0 0 6px; text-align: center; font-weight: 700; }
.card .price { color: var(--zoma-blue); font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 14px; }
.card .sku { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.card .card-actions { margin-top: auto; }

.tag-pill {
    position: absolute; top: 14px; right: 14px;
    font-size: 11px; font-weight: 800; letter-spacing: .5px;
    padding: 5px 11px; border-radius: 999px; text-transform: uppercase;
}
.tag-pill.draft { background: var(--warn); color: #fff; }
.tag-pill.active { background: var(--ok); color: #fff; }
.tag-pill.archived { background: #8a96a3; color: #fff; }

/* ---------- Qty + variant ---------- */
.qty {
    display: inline-flex; align-items: center;
    border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.qty button { width: 36px; height: 40px; border: 0; background: #fff; font-size: 18px; cursor: pointer; color: var(--ink); }
.qty input { width: 46px; height: 40px; border: 0; text-align: center; font-family: var(--font); font-size: 15px; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

select.variant-select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: 10px; font-family: var(--font); font-size: 14px; margin-bottom: 12px;
}

/* ---------- Login ---------- */
.auth-shell {
    min-height: calc(100vh - 134px);
    display: grid; place-items: center;
    background: linear-gradient(180deg, var(--zoma-blue-soft), #fff);
    padding: 40px 18px;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 18px; box-shadow: var(--shadow);
    padding: 38px 34px;
}
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card h1 { font-size: 22px; text-align: center; margin: 6px 0 4px; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.field input {
    width: 100%; padding: 13px 14px;
    border: 1px solid var(--line); border-radius: 10px;
    font-family: var(--font); font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--zoma-blue); box-shadow: 0 0 0 3px var(--zoma-blue-soft); }
.auth-note { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }

/* ---------- Cart / table ---------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 12px; border-bottom: 2px solid var(--line); }
.cart-table td { padding: 16px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-table .ci-img { width: 64px; height: 64px; background: var(--bg-alt); border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.cart-table .ci-img img { max-height: 90%; width: auto; }
.cart-summary {
    margin-left: auto; max-width: 380px;
    border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.cart-summary .row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.cart-summary .row.total { font-size: 19px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.muted-note { color: var(--muted); font-size: 12px; margin-top: 10px; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-state svg { opacity: .5; margin-bottom: 14px; }

.link-remove { color: var(--danger); font-size: 13px; background: none; border: 0; cursor: pointer; font-family: var(--font); }
.link-remove:hover { text-decoration: underline; }

/* ---------- Checkout form ---------- */
.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 34px;
    align-items: start;
    margin-bottom: 50px;
}
.sec-title { font-size: 17px; margin: 4px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 26px;
}
.form-grid .field { margin-bottom: 0; }
.form-grid .field.span2 { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
    width: 100%; padding: 11px 12px;
    border: 1px solid var(--line); border-radius: 9px;
    font-family: var(--font); font-size: 14px; background: #fff;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
    outline: none; border-color: var(--zoma-blue); box-shadow: 0 0 0 3px var(--zoma-blue-soft);
}
.form-grid label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 5px; color: var(--ink); }

/* ---------- Filter bar (catalogo) ---------- */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    margin-bottom: 22px;
}
.filter-bar .search {
    position: relative; flex: 1; min-width: 240px;
}
.filter-bar .search input {
    width: 100%; padding: 12px 14px 12px 40px;
    border: 1px solid var(--line); border-radius: 10px;
    font-family: var(--font); font-size: 15px;
}
.filter-bar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); }
.filter-bar select {
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
    font-family: var(--font); font-size: 14px; background: #fff; min-width: 180px;
}
.no-results { text-align: center; color: var(--muted); padding: 50px 20px; display: none; }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 60px; border-top: 1px solid var(--line);
    background: var(--bg-alt); color: var(--muted);
    font-size: 13px;
}
.site-footer .wrap { padding: 26px 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Storico ordini ---------- */
.orders-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.order-card {
    border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; overflow: hidden;
}
.order-card__head {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 16px 22px; background: var(--bg-alt); border-bottom: 1px solid var(--line);
}
.order-card__name { font-weight: 800; font-size: 16px; color: var(--ink); }
.order-card__date { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.order-card__total { margin-left: auto; font-weight: 800; font-size: 17px; color: var(--ink); }

.status-badge {
    font-size: 11px; font-weight: 800; letter-spacing: .4px;
    padding: 5px 12px; border-radius: 999px; text-transform: uppercase; white-space: nowrap;
}
.status-badge.ok     { background: #e7f6ec; color: #1c7a3c; }
.status-badge.info   { background: var(--zoma-blue-soft); color: var(--zoma-blue-dark); }
.status-badge.warn   { background: #fcf3e0; color: #9a6b12; }
.status-badge.danger { background: #fbe9e8; color: #b23b37; }

.order-card__body { padding: 4px 22px; }
.order-line {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0; border-bottom: 1px solid var(--line);
}
.order-line:last-child { border-bottom: 0; }
.order-line .ci-img {
    width: 52px; height: 52px; flex: 0 0 auto;
    background: var(--bg-alt); border-radius: 8px;
    display: grid; place-items: center; overflow: hidden;
}
.order-line .ci-img img { max-height: 90%; width: auto; }
.order-line .ol-info { flex: 1; min-width: 0; }
.order-line .ol-title { font-weight: 700; font-size: 14px; }
.order-line .ol-meta { color: var(--muted); font-size: 12.5px; }
.order-line .ol-amt { font-weight: 700; white-space: nowrap; }

@media (max-width: 600px) {
    .order-card__total { margin-left: 0; width: 100%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .main-nav { gap: 18px; }
    .site-header .wrap { height: 76px; }
    .checkout-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
    .topbar .wrap { gap: 16px; font-size: 12px; }
    .brand .logo-text strong { font-size: 24px; }
}
