/* ============================================================
   Zestora Design System — single source of visual truth
   Panels: storefront, account, seller, admin
   ============================================================ */
:root {
  --zs-primary: #0D9488;       /* sea-green teal */
  --zs-primary-dark: #0A7A70;  /* deeper teal for hover */
  --zs-primary-soft: #E0F5F3;  /* light teal tint */
  --zs-secondary: #0F2D3D;     /* deep ocean — navbar / topbar */
  --zs-accent: #F59E0B;        /* warm amber — badges, highlights */
  --zs-success: #2e7d32;
  --zs-danger: #c62828;
  --zs-warning: #F59E0B;
  --zs-bg: #F2FAFA;            /* faint sea-tinted page bg */
  --zs-card: #ffffff;
  --zs-border: #d4eae8;
  --zs-text: #0F2D2A;          /* deep teal-charcoal headings */
  --zs-text-dim: #6b7280;
  --zs-radius: .65rem;
  --zs-shadow: 0 .125rem .75rem rgba(13, 60, 55, .08);
  --panel-sidebar: 260px;
}

body { background: var(--zs-bg); color: var(--zs-text); font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }

a { text-decoration: none; }
.text-orange { color: var(--zs-primary) !important; }
.bg-orange { background-color: var(--zs-primary) !important; }
.bg-zs { background: var(--zs-secondary) !important; }
.bg-zs-soft { background: var(--zs-primary-soft) !important; }

.btn-orange { background: var(--zs-primary); border-color: var(--zs-primary); color: #fff; }
.btn-orange:hover, .btn-orange:focus { background: var(--zs-primary-dark); border-color: var(--zs-primary-dark); color: #fff; }
.btn-outline-orange { color: var(--zs-primary); border-color: var(--zs-primary); }
.btn-outline-orange:hover { background: var(--zs-primary); color: #fff; }

.card { border: 1px solid var(--zs-border); border-radius: var(--zs-radius); box-shadow: var(--zs-shadow); }
.form-control:focus, .form-select:focus { border-color: var(--zs-primary); box-shadow: 0 0 0 .2rem rgba(13,148,136,.15); }
.badge-soft { background: #eef1f7; color: var(--zs-text-dim); font-weight: 600; }

/* ---------------------------------------------------------------- auth */
.auth-body { background: linear-gradient(135deg, #E8F7F5 0%, #F2FAFA 60%); }
.auth-card { width: min(460px, 92vw); border-radius: 1rem; }
.auth-brand .auth-logo { width: 42px; height: 42px; background: var(--zs-primary); color: #fff; font-size: 1.3rem; }

/* ---------------------------------------------------------- storefront */
.zs-topbar { background: var(--zs-secondary); color: #cbd2e1; font-size: .8rem; }
.zs-header { background: #fff; border-bottom: 1px solid var(--zs-border); }
.zs-header .form-control { border-radius: 2rem 0 0 2rem; border-color: var(--zs-primary); }
.zs-header .btn-search { border-radius: 0 2rem 2rem 0; }
.zs-catbar { background: #fff; border-bottom: 1px solid var(--zs-border); font-size: .875rem; }
.zs-catbar a.cat-link { color: var(--zs-text); padding: .55rem .9rem; display: inline-block; font-weight: 500; }
.zs-catbar a.cat-link:hover { color: var(--zs-primary); }

.zs-product-card { background: #fff; border-radius: var(--zs-radius); overflow: hidden; height: 100%; transition: transform .18s ease, box-shadow .18s ease; display: block; color: inherit; }
.zs-product-card:hover { transform: translateY(-3px); box-shadow: 0 .35rem 1rem rgba(23,32,55,.12); }
.zs-product-card .pimg { position: relative; aspect-ratio: 1/1; background: #f0f1f5; }
.zs-product-card .pimg img { width: 100%; height: 100%; object-fit: cover; }
.zs-product-card .pbadge { position: absolute; top: .5rem; left: .5rem; background: var(--zs-primary); color: #fff; font-size: .7rem; padding: .15rem .45rem; border-radius: .35rem; z-index: 2; }
.zs-product-card .ptitle { font-size: .86rem; color: var(--zs-text); min-height: 2.9em; }
.zs-product-card .pprice { color: var(--zs-primary); font-weight: 700; font-size: .95rem; }
.zs-product-card .psold { font-size: .72rem; color: var(--zs-text-dim); }
.zs-product-card .sold-bar { height: 4px; border-radius: 2px; background: #b2e4df; }
.zs-product-card .sold-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--zs-primary); }
.zs-grid-list .stars { color: var(--zs-warning); font-size: .78rem; letter-spacing: .05em; }

/* flash sale */
.zs-flash .count-badge { background: var(--zs-secondary); color: #fff; border-radius: .4rem; padding: .15rem .5rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ panels */
.panel-shell { display: flex; min-height: 100vh; }
.panel-sidebar { width: var(--panel-sidebar); min-height: 100vh; background: var(--zs-card); border-right: 1px solid var(--zs-border); position: sticky; top: 0; }
.panel-sidebar .brand { font-weight: 800; letter-spacing: -.5px; }
.panel-sidebar .nav-link { color: var(--zs-text); font-weight: 500; border-radius: .5rem; padding: .5rem .8rem; margin: .12rem .5rem; font-size: .9rem; }
.panel-sidebar .nav-link i { width: 1.35rem; text-align: center; }
.panel-sidebar .nav-link:hover { background: #f3f4f8; }
.panel-sidebar .nav-link.active { background: var(--zs-bg); color: var(--zs-primary); }
.panel-sidebar .nav-section { font-size: .7rem; text-transform: uppercase; color: #9aa1af; font-weight: 700; padding: .8rem 1.1rem .3rem; }
.panel-main { flex: 1 1 auto; min-width: 0; }
.panel-topbar { background: #fff; border-bottom: 1px solid var(--zs-border); }
.stat-card .stat-icon { width: 46px; height: 46px; border-radius: .8rem; display: grid; place-items: center; font-size: 1.2rem; }
.table-hover > tbody > tr:hover { background: #fafbfd; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--zs-primary); color: #fff; display: inline-grid; place-items: center; font-weight: 700; }

table.zs-table td, table.zs-table th { vertical-align: middle; font-size: .9rem; }

/* ---------------------------------------------------------- misc */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--zs-text-dim); }
.empty-state i { font-size: 3rem; display: block; margin-bottom: .8rem; color: #c9ced9; }
.cursor-pointer { cursor: pointer; }
.zs-img-zoom img { transition: transform .25s ease; }
.zs-img-zoom:hover img { transform: scale(1.35); }
.stars-sm { color: var(--zs-warning); font-size: .82rem; }

@media (max-width: 991.98px) {
  .panel-sidebar { position: fixed; z-index: 1040; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 2rem rgba(0,0,0,.2); }
  .panel-sidebar.open { transform: none; }
  .zs-sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,18,25,.45); z-index: 1035; display: none; }
  .zs-sidebar-backdrop.show { display: block; }
}

/* ================= Mobile responsiveness layer ================= */

/* 1. Topbar on phones: smaller page titles, tighter spacing */
@media (max-width: 575.98px) {
  .panel-topbar h5 { font-size: 1.02rem; }
  .panel-topbar { padding-left: .65rem; padding-right: .65rem; }
  main.p-3 { padding: .8rem !important; }
}

/* 2. Prevent iOS zoom-on-focus: keep real inputs at >= 16px on phones */
@media (max-width: 575.98px) {
  .form-control, .form-select { font-size: max(16px, 1rem); }
  .form-control-sm, .form-select-sm {
    font-size: max(15px, .925rem);
    padding-top: .4rem; padding-bottom: .4rem;
  }
  .input-group-sm .form-control, .input-group-sm .form-select { font-size: max(15px, .9rem); }
}

/* 3. Long identifiers (order numbers, refs, SKUs, IBANs) wrap instead of overflowing */
code.user-select-all, .zs-break-all { overflow-wrap: anywhere; word-break: break-word; }

/* 4. Buttons inside flex action rows may wrap; keep touch targets comfortable */
@media (max-width: 575.98px) {
  .btn-sm { padding: .4rem .65rem; }
  .d-flex.gap-2 > .btn { flex-shrink: 0; }
}

/* 5. Tables inside .table-responsive: allow long text to wrap, keep it tidy */
.table-responsive .table { margin-bottom: 0; }

/* 6. Big status icons on the success/error pages shrink to fit phones */
@media (max-width: 575.98px) {
  .display-1 { font-size: 2.75rem; }
}

/* 7. Header search row on phones: full-width search input */
@media (max-width: 991.98px) {
  .zs-header .form .js-zs-search { margin-bottom: .35rem; }
}

/* 8. Summary/definition rows produced by dl.row stay stackable (dd wraps) */
dl.row > dd, dl.row > dt { min-width: 0; }

/* 9. Offcanvas/backdrop z-index above sticky header elements */
.offcanvas { z-index: 1045; }

/* 10. Print: wrappers must never clip invoice/packing-slip content */
@media print {
  .table-responsive { overflow-x: visible !important; }
  .zs-sidebar-backdrop { display: none !important; }
}
