/* ============================================================
   CyberSec Store — Main Stylesheet
   Professional dark-themed cybersecurity e-commerce store
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS Custom Properties (Theming Variables)
   ------------------------------------------------------------ */
:root {
  --bg-primary: #1e293b;
  --bg-secondary: #0f172a;
  --bg-body: #020617;
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #facc15;
  --accent-hover: #f59e0b;
  --success: #22c55e;
  --danger: #ef4444;
  --border: #334155;

  /* Derived / utility variables */
  --font-sans: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --glass-bg: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ------------------------------------------------------------
   2. Global Styles & Reset
   ------------------------------------------------------------ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

ul, ol {
  list-style: none;
}

/* ------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

small {
  font-size: 0.875rem;
}

/* ------------------------------------------------------------
   4. Utility Classes
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------
   5. Custom Navbar — Sticky Top, Glass-morphism
   ------------------------------------------------------------ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-base);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.navbar-brand .brand-icon {
  font-size: 1.5rem;
  color: var(--accent);
}

.navbar-brand:hover {
  color: var(--accent);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.navbar-nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.navbar-toggler {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
}

.navbar-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  padding: 0 5px;
  margin-left: 4px;
  vertical-align: super;
}

/* ------------------------------------------------------------
   6. Hero Section — Gradient Overlay
   ------------------------------------------------------------ */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 85vh;
  padding: 4rem 1.5rem;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(2, 6, 23, 0.92) 0%, rgba(30, 41, 59, 0.85) 100%),
    url('../images/hero-bg.jpg') center / cover no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(250, 204, 21, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(34, 197, 94, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 1.15rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ------------------------------------------------------------
   8. Product Cards — Hover Lift, Image Placeholder
   ------------------------------------------------------------ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.product-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-image .placeholder-icon {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.4;
}

.product-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.product-card-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem 1.25rem;
}

.product-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.product-card-price .original-price {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 0.5rem;
}

.product-card-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ------------------------------------------------------------
   9. Rating Stars (Filled / Empty)
   ------------------------------------------------------------ */
.stars {
  display: inline-flex;
  gap: 2px;
}

.star {
  font-size: 1rem;
  color: var(--text-muted);
  position: relative;
}

.star.filled {
  color: var(--accent);
}

.star.half {
  color: var(--accent);
  position: relative;
}

.star.half::after {
  content: '★';
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  overflow: hidden;
  color: var(--text-muted);
}

.star.empty {
  color: var(--border);
}

.rating-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

/* ------------------------------------------------------------
   10. Discount & Sale Badges
   ------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-sale {
  background: var(--danger);
  color: #fff;
}

.badge-discount {
  background: var(--accent);
  color: #0f172a;
}

.badge-new {
  background: var(--success);
  color: #fff;
}

.badge-featured {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.product-card-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 2;
}

/* ------------------------------------------------------------
   11. Pricing Tables — Highlighted 'Recommended' Tier
   ------------------------------------------------------------ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.pricing-card {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pricing-card.recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
  transform: scale(1.03);
}

.pricing-card.recommended:hover {
  transform: scale(1.03) translateY(-4px);
}

.pricing-card .recommended-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.3rem 1.25rem;
  border-radius: var(--radius-full);
}

.pricing-card .plan-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pricing-card .plan-price {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.pricing-card .plan-price .currency {
  font-size: 1.5rem;
  vertical-align: super;
}

.pricing-card .plan-price .period {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-card .plan-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.pricing-card .plan-features {
  text-align: left;
  margin-bottom: 1.75rem;
}

.pricing-card .plan-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.pricing-card .plan-features li:last-child {
  border-bottom: none;
}

.pricing-card .plan-features li .feat-icon {
  color: var(--success);
  font-size: 1rem;
  flex-shrink: 0;
}

.pricing-card .plan-features li .feat-icon.missing {
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   12. Flash Messages & Alerts
   ------------------------------------------------------------ */
.flash-messages {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  width: calc(100% - 3rem);
}

.flash-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  animation: slideInRight var(--transition-base) ease forwards;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.flash-message .flash-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.flash-message .flash-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 0.25rem;
  line-height: 1;
}

.flash-message .flash-close:hover {
  color: var(--text-primary);
}

.flash-message.flash-success {
  border-left: 4px solid var(--success);
}

.flash-message.flash-success .flash-icon {
  color: var(--success);
}

.flash-message.flash-error,
.flash-message.flash-danger {
  border-left: 4px solid var(--danger);
}

.flash-message.flash-error .flash-icon,
.flash-message.flash-danger .flash-icon {
  color: var(--danger);
}

.flash-message.flash-info {
  border-left: 4px solid var(--accent);
}

.flash-message.flash-info .flash-icon {
  color: var(--accent);
}

.flash-message.flash-warning {
  border-left: 4px solid var(--accent-hover);
}

.flash-message.flash-warning .flash-icon {
  color: var(--accent-hover);
}

/* ------------------------------------------------------------
   13. Cart Quantity Controls (+/- Buttons)
   ------------------------------------------------------------ */
.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-secondary);
}

.quantity-control button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-primary);
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.quantity-control button:hover {
  background: var(--accent);
  color: #0f172a;
}

.quantity-control button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quantity-control .quantity-input {
  width: 48px;
  height: 36px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  -moz-appearance: textfield;
}

.quantity-control .quantity-input::-webkit-outer-spin-button,
.quantity-control .quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ------------------------------------------------------------
   14. Dashboard Cards with Icons
   ------------------------------------------------------------ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.dashboard-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dashboard-card .card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(250, 204, 21, 0.1);
  color: var(--accent);
  font-size: 1.35rem;
  flex-shrink: 0;
}

.dashboard-card .card-icon.icon-success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.dashboard-card .card-icon.icon-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.dashboard-card .card-icon.icon-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.dashboard-card .card-body {
  flex: 1;
  min-width: 0;
}

.dashboard-card .card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.dashboard-card .card-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.dashboard-card .card-change {
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.dashboard-card .card-change.positive {
  color: var(--success);
}

.dashboard-card .card-change.negative {
  color: var(--danger);
}

/* ------------------------------------------------------------
   15. Table Styling (Dark Mode)
   ------------------------------------------------------------ */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--bg-secondary);
}

th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.85rem 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

/* ------------------------------------------------------------
   16. Order Status Badges (Pending, Completed, Failed)
   ------------------------------------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.pending {
  background: rgba(250, 204, 21, 0.12);
  color: var(--accent);
}

.status-badge.pending::before {
  background: var(--accent);
}

.status-badge.completed,
.status-badge.success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.status-badge.completed::before,
.status-badge.success::before {
  background: var(--success);
}

.status-badge.failed,
.status-badge.danger,
.status-badge.cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.status-badge.failed::before,
.status-badge.danger::before,
.status-badge.cancelled::before {
  background: var(--danger);
}

.status-badge.processing {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.status-badge.processing::before {
  background: #3b82f6;
}

.status-badge.shipped {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.status-badge.shipped::before {
  background: #8b5cf6;
}

/* ------------------------------------------------------------
   17. Form Input Styling (Dark Theme)
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.15);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-input.success,
.form-select.success,
.form-textarea.success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%2394a3b8'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-checkbox,
.form-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.form-checkbox input[type="checkbox"],
.form-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.form-radio input[type="radio"] {
  border-radius: 50%;
}

.form-checkbox input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%230f172a'%3E%3Cpath d='M10 3L4.5 8.5 2 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.form-radio input[type="radio"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--bg-secondary);
}

.form-error {
  font-size: 0.825rem;
  color: var(--danger);
  margin-top: 0.3rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ------------------------------------------------------------
   18. Footer Styling
   ------------------------------------------------------------ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-column h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column ul li a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-column ul li a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-muted);
}

.footer-bottom a:hover {
  color: var(--accent);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}

/* ------------------------------------------------------------
   19. Loading Spinner
   ------------------------------------------------------------ */
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(2, 6, 23, 0.8);
  z-index: 99999;
}

.loading-overlay .loading-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   20. Scrollbar Styling (Dark Theme)
   ------------------------------------------------------------ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-body);
}

/* ------------------------------------------------------------
   21. Animations & Keyframes
   ------------------------------------------------------------ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn var(--transition-base) ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp var(--transition-base) ease forwards;
}

.animate-slide-in-up {
  animation: slideInUp var(--transition-base) ease forwards;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Staggered animation for grid items */
.product-grid .product-card:nth-child(1) { animation-delay: 0ms; }
.product-grid .product-card:nth-child(2) { animation-delay: 80ms; }
.product-grid .product-card:nth-child(3) { animation-delay: 160ms; }
.product-grid .product-card:nth-child(4) { animation-delay: 240ms; }
.product-grid .product-card:nth-child(5) { animation-delay: 320ms; }
.product-grid .product-card:nth-child(6) { animation-delay: 400ms; }

/* ------------------------------------------------------------
   22. Empty State & Section Headers
   ------------------------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.section-header .section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ------------------------------------------------------------
   23. Modal Overlay
   ------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  padding: 1rem;
  animation: fadeIn 150ms ease;
}

.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 250ms ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.15rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.5rem;
}

/* ------------------------------------------------------------
   24. Shopping Cart Summary
   ------------------------------------------------------------ */
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #0f172a, #1e293b);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.cart-item-price {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

.cart-item-total {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.cart-summary {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.cart-summary-row.total {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.15rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------
   25. Responsive Breakpoints (Mobile-first)
   ------------------------------------------------------------ */

/* Small devices (sm): ≥ 576px */
@media (min-width: 576px) {
  .container {
    padding: 0 1.5rem;
  }

  .hero-content h1 {
    font-size: 3.25rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Medium devices (md): ≥ 768px */
@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }

  .hero {
    min-height: 70vh;
    padding: 5rem 2rem;
  }

  .hero-content h1 {
    font-size: 3.75rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large devices (lg): ≥ 992px */
@media (min-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Extra large (xl): ≥ 1200px */
@media (min-width: 1200px) {
  .hero-content h1 {
    font-size: 4rem;
  }

  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Mobile-specific overrides (max-width) */
@media (max-width: 767px) {
  .navbar-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.75rem;
  }

  .navbar-nav.active {
    display: flex;
  }

  .navbar-toggler {
    display: block;
  }

  .hero-content h1 {
    font-size: 2.25rem;
  }

  .hero {
    min-height: 60vh;
    padding: 3rem 1rem;
  }

  .pricing-card.recommended {
    transform: none;
  }

  .pricing-card.recommended:hover {
    transform: translateY(-4px);
  }

  .flash-messages {
    right: 1rem;
    left: 1rem;
    max-width: none;
    width: auto;
  }

  .table-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item-image {
    width: 50px;
    height: 50px;
  }
}

/* ------------------------------------------------------------
   26. Print-friendly Styles
   ------------------------------------------------------------ */
@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    border-color: #ccc !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .navbar,
  .footer,
  .flash-messages,
  .loading-overlay,
  .modal-overlay,
  .btn,
  .quantity-control button,
  .navbar-toggler,
  .cart-item-remove {
    display: none !important;
  }

  a {
    text-decoration: underline;
    color: #000 !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555 !important;
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  .hero {
    min-height: auto;
    padding: 2rem 0;
  }

  .hero-content h1 {
    -webkit-text-fill-color: #000;
    background: none;
  }

  .product-card {
    break-inside: avoid;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }

  .product-card:hover {
    transform: none;
  }

  table {
    border-collapse: collapse;
  }

  th, td {
    border: 1px solid #ccc !important;
  }

  .status-badge {
    border: 1px solid #999 !important;
  }

  .badge {
    border: 1px solid #999 !important;
  }

  .pricing-card.recommended {
    border: 2px solid #000 !important;
    transform: none;
  }

  .dashboard-card {
    border: 1px solid #ccc !important;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4 {
    page-break-after: avoid;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  @page {
    margin: 2cm;
  }
}

/* ------------------------------------------------------------
   27. Misc — Dividers, Tooltips, Misc Components
   ------------------------------------------------------------ */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 100;
}

.tooltip:hover::after {
  opacity: 1;
}

.shimmer-placeholder {
  background: linear-gradient(
    90deg,
    var(--bg-primary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-primary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* Scroll-to-top button */
.scroll-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  opacity: 0;
  visibility: hidden;
  z-index: 500;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}
