/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, Arial, sans-serif; color: #1f2937; background: #f7f8fa; line-height: 1.5; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5em; color: #111827; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ===== Header ===== */
.site-header { background: #fff; border-bottom: 1px solid #e5e7eb; box-shadow: 0 2px 6px rgba(0,0,0,.04); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 16px; padding: 12px 16px; flex-wrap: wrap; }
.logo { font-size: 22px; font-weight: 800; color: #2563eb; }
.main-nav { display: flex; gap: 16px; flex: 1; margin-left: 24px; }
.main-nav a { color: #374151; font-weight: 500; padding: 8px 4px; }
.main-nav a:hover { color: #2563eb; text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { position: relative; padding: 8px; font-size: 18px; color: #374151; }
.icon-btn .badge { position: absolute; top: -4px; right: -8px; background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 6px; min-width: 18px; text-align: center; }
.user-chip { background: #eef2ff; padding: 4px 10px; border-radius: 999px; font-size: 13px; color: #3730a3; }

/* ===== Buttons ===== */
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-size: 14px; font-weight: 500; text-align: center; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; text-decoration: none; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; text-decoration: none; }
.btn-outline { background: transparent; color: #2563eb; border-color: #2563eb; }
.btn-outline:hover { background: #eff6ff; text-decoration: none; }
.btn-link { background: transparent; color: #6b7280; padding: 8px 4px; }
.btn-block { display: block; width: 100%; }

/* ===== Main / Cards ===== */
.site-main { padding: 24px 16px 56px; min-height: 60vh; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 20px; margin-bottom: 20px; }
.section-title { font-size: 22px; margin: 24px 0 14px; color: #111827; border-left: 4px solid #2563eb; padding-left: 10px; }

/* ===== Banner Slider ===== */
.slider { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 4/1; margin-bottom: 24px; background: #f3f4f6; }
.slider .slides { position: relative; width: 100%; height: 100%; }
.slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease-in-out; pointer-events: none; display: block; background: linear-gradient(135deg,#2563eb,#7c3aed); }
.slider .slide.active { opacity: 1; pointer-events: auto; }
.slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider .slide-fallback { position: absolute; inset: 0; display: flex; align-items: center; padding: 24px; color: #fff; font-size: 28px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: none; border-radius: 50%; background: rgba(255,255,255,.85); color: #1f2937; font-size: 28px; line-height: 1; cursor: pointer; z-index: 5; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.slider-arrow:hover { background: #fff; }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }
.slider-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.slider-dots .dot { width: 10px; height: 10px; border-radius: 50%; border: none; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; transition: background .15s, transform .15s; }
.slider-dots .dot.active { background: #fff; transform: scale(1.2); }
@media (max-width: 600px) {
  .slider { aspect-ratio: 16/9; }
  .slider .slide-fallback { font-size: 18px; padding: 16px; }
  .slider-arrow { width: 32px; height: 32px; font-size: 22px; }
}

/* ===== Product grid ===== */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); position: relative; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.product-card .img-wrap { aspect-ratio: 1/1; background: #f3f4f6; position: relative; overflow: hidden; }
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-card .info { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.product-card .name { font-weight: 600; color: #111827; margin-bottom: 6px; line-height: 1.3; min-height: 38px; }
.product-card .meta { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.product-card .price { font-size: 18px; font-weight: 700; color: #16a34a; }
.product-card .mrp { font-size: 13px; color: #9ca3af; text-decoration: line-through; margin-left: 6px; }
.product-card .actions { display: flex; gap: 6px; margin-top: 10px; }
.product-card .actions .btn { flex: 1; padding: 6px 8px; font-size: 12px; }
.fav-btn { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; background: rgba(255,255,255,.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; font-size: 16px; color: #6b7280; }
.fav-btn.active { color: #ef4444; }
.disabled-tag { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; font-size: 11px; border-radius: 4px; }

/* ===== Filters ===== */
.products-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
@media (max-width: 768px) { .products-layout { grid-template-columns: 1fr; } }
.filters { background: #fff; padding: 16px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.filters h4 { font-size: 14px; margin-top: 14px; margin-bottom: 6px; color: #6b7280; text-transform: uppercase; letter-spacing: .5px; }
.filters label { display: block; padding: 4px 0; font-size: 14px; cursor: pointer; }
.filters input[type=checkbox], .filters input[type=radio] { margin-right: 6px; }

/* ===== Product detail ===== */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: #fff; padding: 24px; border-radius: 12px; }
@media (max-width: 768px) { .product-detail { grid-template-columns: 1fr; } }
.product-images .main-img { aspect-ratio: 1/1; background: #f3f4f6; border-radius: 8px; overflow: hidden; }
.product-images .main-img img { width: 100%; height: 100%; object-fit: contain; }
.product-images .thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.product-images .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.product-images .thumbs img.active { border-color: #2563eb; }
.product-info h1 { font-size: 24px; }
.product-info .price-box { font-size: 28px; font-weight: 800; color: #16a34a; margin: 12px 0; }
.product-info .price-box .mrp { color: #9ca3af; font-size: 18px; text-decoration: line-through; margin-left: 12px; font-weight: 500; }
.qty-box { display: inline-flex; align-items: center; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; }
.qty-box button { width: 36px; height: 36px; border: none; background: #f3f4f6; cursor: pointer; font-size: 18px; }
.qty-box input { width: 50px; text-align: center; border: none; height: 36px; font-size: 16px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.form-control, input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; background: #fff;
}
.form-control:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.auth-card { max-width: 420px; margin: 24px auto; }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.table th { background: #f9fafb; font-weight: 600; color: #4b5563; }
.table tbody tr:hover { background: #f9fafb; }

/* ===== Cart / Checkout ===== */
.cart-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 768px) { .cart-layout { grid-template-columns: 1fr; } }
.summary-box { background: #fff; padding: 18px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); position: sticky; top: 84px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-row.total { border-top: 2px solid #e5e7eb; margin-top: 10px; padding-top: 10px; font-weight: 700; font-size: 16px; }

/* ===== Flash ===== */
.flash { padding: 12px 16px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }
.flash-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.flash-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.flash-warning { background: #fef3c7; color: #78350f; border-left: 4px solid #f59e0b; }
.flash-info { background: #dbeafe; color: #1e3a8a; border-left: 4px solid #3b82f6; }

/* ===== Badges ===== */
.badge-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.s-pending { background: #fef3c7; color: #78350f; }
.s-accepted { background: #dbeafe; color: #1e3a8a; }
.s-sent { background: #e0e7ff; color: #3730a3; }
.s-delivered { background: #d1fae5; color: #065f46; }
.s-cancelled { background: #fee2e2; color: #991b1b; }
.s-paid { background: #d1fae5; color: #065f46; }
.s-failed { background: #fee2e2; color: #991b1b; }

/* ===== Footer ===== */
.site-footer { background: #111827; color: #d1d5db; padding: 36px 16px 16px; margin-top: 48px; }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 24px; max-width: 1200px; margin: 0 auto; }
.footer-inner h4 { color: #fff; margin-bottom: 10px; }
.footer-inner a { color: #d1d5db; display: block; padding: 4px 0; }
.copyright { text-align: center; color: #9ca3af; font-size: 13px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #374151; }

/* ===== Misc ===== */
.text-muted { color: #6b7280; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mt-3 { margin-top: 16px; }
.empty-state { text-align: center; padding: 40px; color: #6b7280; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ===== Course / Blog cards ===== */
.course-card, .blog-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: transform .15s, box-shadow .15s; }
.course-card:hover, .blog-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.course-card .img, .blog-card .img { aspect-ratio: 16/9; background: linear-gradient(135deg,#2563eb,#7c3aed); }
.course-card .img img, .blog-card .img img { width: 100%; height: 100%; object-fit: cover; }
.course-card .info, .blog-card .info { padding: 14px; }
.course-card .info h3, .blog-card .info h3 { font-size: 16px; }
.course-card .fees { color: #2563eb; font-weight: 700; font-size: 18px; margin-top: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ===== Print invoice ===== */
@media print {
  .site-header, .site-footer, .no-print, .admin-sidebar, .admin-topbar { display: none !important; }
  body { background: #fff; }
}
.invoice-box { background: #fff; padding: 32px; border: 1px solid #e5e7eb; max-width: 800px; margin: 0 auto; }
.invoice-header { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #2563eb; padding-bottom: 16px; margin-bottom: 16px; }
.invoice-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.invoice-table th, .invoice-table td { border: 1px solid #e5e7eb; padding: 8px; font-size: 14px; }
.invoice-table th { background: #f9fafb; }
