/* /assets/css/style.css */
:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;

  --primary:#2563eb;
  --primary-700:#1d4ed8;
  --success:#16a34a;
  --danger:#dc2626;

  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --shadow-sm: 0 6px 16px rgba(2,6,23,.06);
  --radius: 16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.45;
}

a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}
.container{max-width:1100px; margin:0 auto; padding:18px 14px;}

/* -----------------------
   Navbar (Pro)
------------------------ */
.nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: #0b1220;
  color:#fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav .container{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}

.nav .left, .nav .right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.nav a{
  color:rgba(255,255,255,.90);
  padding:8px 10px;
  border-radius:12px;
  transition: background .15s ease, transform .15s ease;
}
.nav a:hover{
  background: rgba(255,255,255,.10);
  transform: translateY(-1px);
}
.nav strong{
  letter-spacing:.4px;
}

/* -----------------------
   Typography
------------------------ */
h1,h2,h3{margin:0 0 10px}
h2{font-size:1.6rem}
h3{font-size:1.05rem}
.muted{color:var(--muted)}
.small{font-size:.9rem}

/* -----------------------
   Cards
------------------------ */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* -----------------------
   Grid / Product listing
------------------------ */
.grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
}

.product-img{
  width:100%;
  height:190px;
  object-fit:cover;
  border-radius: 14px;
  border:1px solid var(--border);
  background:#f1f5f9;
}

.price{
  font-weight:800;
  font-size:1.05rem;
  margin-top:6px;
}

.line-clamp-2{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  min-height: 44px;
}

/* -----------------------
   Buttons
------------------------ */
.btn, button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  padding:10px 12px;
  border-radius: 14px;
  border:1px solid transparent;
  cursor:pointer;
  text-decoration:none;
  font-weight:700;
  transition: transform .12s ease, filter .12s ease, background .12s ease, border-color .12s ease;
}

.btn:active, button:active{ transform: translateY(1px); }

.btn-primary{
  background:var(--primary);
  color:#fff;
}
.btn-primary:hover{ background:var(--primary-700); }

.btn-light{
  background:#eef2ff;
  border-color:#e0e7ff;
  color:#1e3a8a;
}
.btn-light:hover{ filter:brightness(.97); }

.btn-danger{
  background:var(--danger);
  color:#fff;
}
.btn-danger:hover{ filter:brightness(.95); }

.btn-outline{
  background:transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover{
  background:#f1f5f9;
}

/* -----------------------
   Forms
------------------------ */
input, select, textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--border);
  border-radius: 14px;
  outline:none;
  background:#fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* -----------------------
   Table
------------------------ */
table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
  border:1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
}
th,td{
  padding:12px;
  border-bottom:1px solid var(--border);
  text-align:left;
}
th{
  background:#f8fafc;
  font-weight:800;
}
tr:last-child td{ border-bottom:0; }

/* -----------------------
   Badges / Alerts
------------------------ */
.badge{
  display:inline-flex;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}
.badge-green{background:#dcfce7; color:#166534}
.badge-red{background:#fee2e2; color:#991b1b}
.badge-gray{background:#e5e7eb; color:#111827}

.flash{
  padding:12px 14px;
  border-radius: var(--radius);
  margin-bottom:12px;
  border:1px solid var(--border);
}
.flash-ok{background:#dcfce7; color:#166534; border-color:#bbf7d0}
.flash-err{background:#fee2e2; color:#991b1b; border-color:#fecaca}

/* -----------------------
   Hero (optional section)
------------------------ */
.hero{
  background: linear-gradient(135deg, rgba(37,99,235,.12), rgba(22,163,74,.10));
  border: 1px solid rgba(2,6,23,.06);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

/* -----------------------
   Responsive
------------------------ */
@media (max-width: 1024px){
  .grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px){
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav .container{ gap:10px; }
}
@media (max-width: 520px){
  .grid{ grid-template-columns: 1fr; }
  .nav .container{flex-direction:column; align-items:flex-start}
}

/* -----------------------
   Product Card Hover
------------------------ */
.card a:hover .product-img{
  transform: scale(1.03);
}

.product-img{
  transition: transform .25s ease;
}

/* -----------------------
   Card Content Spacing
------------------------ */
.card h3{
  font-weight:700;
  margin-top:10px;
  margin-bottom:6px;
}

/* -----------------------
   Product Price Style
------------------------ */
.price{
  color:#111827;
  font-weight:900;
  font-size:1.1rem;
}

/* -----------------------
   Pagination
------------------------ */
.pager{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
  margin-top:16px;
}

.pager a{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:700;
}

.pager a:hover{
  background:#f1f5f9;
}

.pager .active{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}

/* -----------------------
   Cart Layout
------------------------ */
.cart-layout{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:16px;
}

@media (max-width: 900px){
  .cart-layout{
    grid-template-columns:1fr;
  }
}

/* -----------------------
   Order Summary
------------------------ */
.summary-row{
  display:flex;
  justify-content:space-between;
  padding:10px 0;
  border-bottom:1px solid var(--border);
}

.summary-total{
  font-weight:900;
  font-size:1.2rem;
}

/* -----------------------
   Dashboard Stats
------------------------ */
.stats{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:14px;
  margin-bottom:16px;
}

.stat-number{
  font-size:1.8rem;
  font-weight:900;
}

@media (max-width:700px){
  .stats{
    grid-template-columns:1fr;
  }
}

/* -----------------------
   Order List
------------------------ */
.order-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}

.order-row + .order-row{
  margin-top:10px;
}

/* -----------------------
   Footer
------------------------ */
.footer{
  margin-top:40px;
  padding:18px;
  background:#0b1220;
  color:#fff;
  text-align:center;
  font-size:.9rem;
}
/* =========================
   Contrast Fix (Dark cards)
   Paste at the bottom
========================= */

/* New variables for dark surfaces */
:root{
  --nav-bg:#0b1220;
  --surface-dark:#0f172a;          /* dark card background */
  --text-on-dark:#f8fafc;          /* readable white */
  --muted-on-dark:#cbd5e1;         /* readable muted */
  --border-on-dark:rgba(255,255,255,.10);
  --card-dark-shadow: 0 12px 30px rgba(2,6,23,.35);
}

/* Make navbar consistent */
.nav{ background: var(--nav-bg); }

/* If a card is dark (payment.php style), ensure text is visible */
.card[style*="background"], 
.card.dark,
.dark-card{
  color: var(--text-on-dark);
}

/* FIX: muted text becomes readable on dark backgrounds */
.card[style*="background"] .muted,
.card.dark .muted,
.dark-card .muted{
  color: var(--muted-on-dark);
}

/* FIX: links inside dark cards */
.card[style*="background"] a,
.card.dark a,
.dark-card a{
  color: var(--text-on-dark);
}

/* FIX: borders inside dark cards */
.card[style*="background"],
.card.dark,
.dark-card{
  border-color: var(--border-on-dark) !important;
  box-shadow: var(--card-dark-shadow);
}

/* FIX: tables inside dark cards (if any) */
.card[style*="background"] table,
.card.dark table,
.dark-card table{
  background: rgba(255,255,255,.06);
  border-color: var(--border-on-dark);
}
.card[style*="background"] th,
.card[style*="background"] td,
.card.dark th, .card.dark td,
.dark-card th, .dark-card td{
  border-color: var(--border-on-dark);
  color: var(--text-on-dark);
}
.card[style*="background"] th,
.card.dark th,
.dark-card th{
  background: rgba(255,255,255,.08);
}

/* FIX: badges look better on dark */
.card[style*="background"] .badge-gray,
.card.dark .badge-gray,
.dark-card .badge-gray{
  background: rgba(255,255,255,.14);
  color: var(--text-on-dark);
}

/* FIX: inputs on dark cards (still white but readable labels) */
.card[style*="background"] label,
.card.dark label,
.dark-card label{
  color: var(--muted-on-dark);
}

/* Optional: make .note boxes readable everywhere */
.note{
  background:#fff;
  color: var(--text);
}
.card[style*="background"] .note,
.card.dark .note,
.dark-card .note{
  background: rgba(255,255,255,.08);
  color: var(--text-on-dark);
  border-color: rgba(255,255,255,.18);
}

/* -----------------------
   Footer (Professional)
------------------------ */

.footer{
  margin-top:40px;
  background: linear-gradient(135deg,#0b1220,#1e293b);
  color:#fff;
  padding:40px 0 20px 0;
}

.footer-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:30px;
}

.footer-col h2{
  font-size:22px;
  margin-bottom:10px;
  color:#60a5fa;
}

.footer-col h4{
  margin-bottom:10px;
  font-size:16px;
  color:#93c5fd;
}

.footer-col p{
  font-size:14px;
  color:#cbd5e1;
}

.footer-col ul{
  list-style:none;
  padding:0;
  margin:0;
}

.footer-col ul li{
  margin-bottom:8px;
}

.footer-col ul li a{
  color:#e2e8f0;
  font-size:14px;
  transition:.2s;
}

.footer-col ul li a:hover{
  color:#60a5fa;
  padding-left:3px;
}

/* social icons */

.socials{
  margin-top:10px;
  display:flex;
  gap:10px;
}

.socials a{
  background:#2563eb;
  padding:6px 10px;
  border-radius:8px;
  font-size:14px;
  transition:.2s;
}

.socials a:hover{
  background:#1d4ed8;
}

/* payment badges */

.payments{
  margin-top:10px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.payments span{
  background:#1e40af;
  padding:4px 8px;
  border-radius:6px;
  font-size:12px;
}

/* footer bottom */

.footer-bottom{
  margin-top:30px;
  padding-top:15px;
  border-top:1px solid rgba(255,255,255,.15);
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:10px;
  font-size:13px;
  color:#cbd5e1;
}

/* responsive */

@media (max-width:900px){
  .footer-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media (max-width:520px){
  .footer-grid{
    grid-template-columns:1fr;
  }

  .footer-bottom{
    text-align:center;
    justify-content:center;
  }
}