/* ===================================================
   DIGIMEX — Public Site Stylesheet
   =================================================== */

:root {
  --bg: #0b0e14;
  --bg-alt: #10141d;
  --surface: #151a24;
  --surface-2: #1b212e;
  --border: #262d3d;
  --text: #e7eaf1;
  --text-muted: #9aa3b5;
  --accent: #3b82f6;
  --accent-hover: #5b93f7;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.25);
  --max-width: 1180px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; margin: 0 0 .5em; }
p { margin: 0 0 1em; color: var(--text-muted); }
.muted { color: var(--text-muted); }

/* ---------------- Header ---------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11,14,20,0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 20px;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark { font-weight: 800; font-size: 22px; letter-spacing: 0.5px; color: var(--text); }
.brand-tag { font-size: 10px; color: var(--text-muted); letter-spacing: 0.6px; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav > a { font-size: 14px; font-weight: 500; color: var(--text-muted); transition: color .15s; }
.main-nav > a:hover { color: var(--text); }

.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  min-width: 200px; padding: 8px; display: none; box-shadow: var(--shadow);
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: var(--text-muted); }
.dropdown-menu a:hover { background: var(--surface-2); color: var(--text); }

.nav-cart { display: flex; align-items: center; gap: 6px; }
.cart-count {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 20px; min-width: 18px; height: 18px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 5px;
}

.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.inline-form { display: inline; }

/* ---------------- Alerts ---------------- */
.alert { padding: 14px 18px; border-radius: var(--radius); margin: 16px 0; font-size: 14px; border: 1px solid transparent; }
.alert-success { background: rgba(34,197,94,.12); color: #4ade80; border-color: rgba(34,197,94,.3); }
.alert-error   { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.3); }
.alert-info    { background: var(--accent-soft); color: #93c5fd; border-color: rgba(59,130,246,.3); }
.alert-warning { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.3); }

/* ---------------- Hero ---------------- */
.hero { padding: 90px 0 70px; text-align: center; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 44px; max-width: 780px; margin: 0 auto 18px; background: linear-gradient(135deg, #fff, #9db4e8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { max-width: 600px; margin: 0 auto 32px; font-size: 17px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------------- Sections ---------------- */
.section { padding: 64px 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 10px; }
.section-header h2 { font-size: 26px; margin: 0; }
.section-header a { font-size: 14px; color: var(--accent); font-weight: 600; }

/* ---------------- Product Grid / Card ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s;
}
.product-card:hover { transform: translateY(-3px); border-color: #34405c; }
.product-card-img { position: relative; aspect-ratio: 16/10; background: var(--surface-2); overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .4px; }
.badge-sale { left: 10px; background: var(--danger); color: #fff; }
.badge-featured { right: 10px; background: var(--warning); color: #1a1a1a; }
.product-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card-category { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); font-weight: 700; }
.product-card-title { font-size: 16px; margin: 0; }
.product-card-desc { font-size: 13px; margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price-old { text-decoration: line-through; color: var(--text-muted); font-size: 13px; margin-right: 6px; }
.price-current { font-size: 17px; font-weight: 700; color: var(--text); }

/* ---------------- Trust / Feature grid ---------------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.feature-card h4 { margin-bottom: 6px; }
.feature-card p { margin: 0; font-size: 14px; }

/* ---------------- Category chips ---------------- */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.category-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: border-color .15s; }
.category-card:hover { border-color: var(--accent); }
.category-card h4 { margin: 0; font-size: 15px; }

/* ---------------- FAQ Accordion ---------------- */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.accordion-question { width: 100%; text-align: left; background: none; border: none; color: var(--text); padding: 16px 20px; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.accordion-answer { padding: 0 20px; max-height: 0; overflow: hidden; transition: all .2s ease; }
.accordion-item.open .accordion-answer { padding: 0 20px 18px; max-height: 600px; }
.accordion-icon { transition: transform .2s; }
.accordion-item.open .accordion-icon { transform: rotate(45deg); }

/* ---------------- Product detail page ---------------- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding: 48px 0; }
.product-gallery img { border-radius: var(--radius-lg); border: 1px solid var(--border); }
.product-gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.product-gallery-thumbs img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; }
.product-info .price-current { font-size: 30px; }
.product-info .price-old { font-size: 16px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.meta-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 12px; color: var(--text-muted); }
.product-actions { display: flex; gap: 12px; margin: 24px 0; }
.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 24px; margin-top: 40px; }
.tab-btn { background: none; border: none; color: var(--text-muted); padding: 12px 0; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--text); border-color: var(--accent); }
.tab-panel { display: none; padding: 24px 0; }
.tab-panel.active { display: block; }

/* ---------------- Cart / Checkout ---------------- */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th, .cart-table td { padding: 14px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.cart-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.cart-product { display: flex; align-items: center; gap: 12px; }
.cart-product img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.qty-input { width: 60px; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 6px; }
.cart-summary { max-width: 380px; margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.summary-total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.coupon-form { display: flex; gap: 8px; margin: 16px 0; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 14px;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }

/* ---------------- Empty state ---------------- */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 60px; padding: 50px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }
.footer-col a, .footer-col span { font-size: 14px; color: var(--text-muted); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 30px; padding-top: 20px; font-size: 13px; color: var(--text-muted); text-align: center; }

/* ---------------- Breadcrumb ---------------- */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin: 20px 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------------- Utility page (privacy/terms/faq page header) ---------------- */
.page-header { padding: 50px 0 20px; }
.page-header h1 { font-size: 32px; }
.content-block { max-width: 800px; }
.content-block p, .content-block li { color: var(--text-muted); }

/* ---------------- Related products ---------------- */
.related-products { margin-top: 60px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .product-detail { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .menu-toggle { display: flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--bg);
    flex-direction: column; align-items: flex-start; gap: 0; border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .2s ease;
  }
  .main-nav.open { max-height: 400px; }
  .main-nav > a, .nav-dropdown { width: 100%; padding: 14px 20px; border-top: 1px solid var(--border); }
  .nav-dropdown .dropdown-menu { position: static; display: block; border: none; margin-top: 8px; padding-left: 10px; background: none; box-shadow: none; }
  .hero h1 { font-size: 30px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cart-summary { max-width: none; }
}
