:root {
  --font-body: "Helvetica Neue", Arial, sans-serif;
  /* RedSky Brand Colors - Dark & Red Theme */
  --color-primary: #171717;      /* Deep neutral-900 black */
  --color-secondary: #dc2626;    /* RedSky signature red-600 */
  --color-accent: #ef4444;       /* Bright red-500 accent */
  --color-red-dark: #b91c1c;     /* Dark red-700 */
  --color-red-light: #f87171;    /* Light red-400 */
  --color-text: #0a0a0a;         /* Rich dark text neutral-950 */
  --color-text-light: #525252;   /* Muted text neutral-600 */
  --color-background: #fafafa;   /* Soft background neutral-50 */
  --color-surface: #ffffff;      /* Card surfaces */
  --color-dark-bg: #0a0a0a;      /* Dark background neutral-950 */
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(220,38,38,0.1);
  --shadow-md: 0 4px 12px rgba(220,38,38,0.15);
  --shadow-lg: 0 10px 24px rgba(220,38,38,0.2);
  --shadow-red: 0 4px 12px rgba(239,68,68,0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  padding-bottom: 3rem; /* approx footer height */
  background-attachment: fixed;
}

header,
footer {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-dark-bg) 100%);
  color: #fff;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Sticky header that remains visible while scrolling */
header {
  position: sticky;
  top: 0;           /* stick to very top of viewport */
  z-index: 1500;    /* ensure it stays above other content */
}

header img {
  height: 30px;
}

h1,
h2,
h3 {
  color: var(--color-primary);
  margin-top: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-accent) 100%) 1;
  padding-bottom: 0.5rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.product {
  border: 1px solid rgba(220,38,38,0.1);
  border-radius: 12px;
  padding: 1.25rem;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.product::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-red);
  border-color: var(--color-red-light);
}

.product:hover::before {
  opacity: 1;
}

.product img {
  max-width: 100%;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.product h3 {
  font-size: 0.95rem;
  line-height: 1.2rem;
  height: 2.4rem; /* 2 lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product p {
  font-size: 0.875rem;
  margin: 0 0 0.25rem 0;
}

.product small {
  font-size: 0.75rem;
  color: #555;
}

.product p.price {
  font-size: 1rem;
  margin-top: auto;
}

.product .sku {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
}

/* ===== Toolbar (search & filter) ===== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(250,250,250,0.95) 100%);
  border-bottom: 2px solid rgba(220,38,38,0.1);
  backdrop-filter: blur(10px);
}

.toolbar input[type="search"],
.toolbar select {
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  border: 2px solid rgba(220,38,38,0.15);
  border-radius: 8px;
  min-width: 200px;
  background: white;
  transition: all 0.2s ease;
}

.toolbar input[type="search"]:focus,
.toolbar select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
  transform: translateY(-1px);
}

/* ===== Category section spacing ===== */
section {
  padding: 1rem 1rem 2rem 1rem;
}

@media (min-width: 768px) {
  section {
    padding: 1.5rem 2rem 3rem 2rem;
  }
}

/* ===== Product card enhancements ===== */
.product:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ===== Layout ===== */
.layout {
  display: flex;
  align-items: flex-start;
}

.layout main {
  flex: 1 1 auto;
  min-width: 0; /* ensures flexbox truncation */
  padding: 1rem 1rem 2rem 1rem;
}

@media (min-width: 768px) {
  .layout main {
    padding: 2rem 3rem;
  }
}

/* ===== Category Sidebar ===== */
.cat-filter {
  width: 200px;
  flex: 0 0 200px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%);
  border-right: 2px solid rgba(220,38,38,0.08);
  padding: 1.5rem 1rem;
  /* Keep filters visible while scrolling the product list */
  position: sticky;
  top: 64px;              /* accounts for header height (sticky header) */
  max-height: calc(100vh - 64px);   /* ensure sidebar doesn't extend past viewport */
  overflow-y: auto;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.cat-filter h3 {
  margin-top: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.cat-filter ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cat-filter li {
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

.cat-filter li.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.cat-filter li:hover:not(.active) {
  background: rgba(220,38,38,0.08);
  color: var(--color-primary);
  transform: translateX(2px);
}

/* Responsive: collapse sidebar on small screens */
@media (max-width: 700px) {
  .layout {
    flex-direction: column;
  }
  .cat-filter {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
    display: flex;
    overflow-x: auto;
  }
  .cat-filter ul {
    display: flex;
    gap: 0.5rem;
  }
  .cat-filter li {
    white-space: nowrap;
  }
}

/* ===== Landing Category Grid Enhancements ===== */
.category-grid {
  display: grid;
  gap: 2rem;
  max-width: 1200px;        /* keep content from stretching edge-to-edge */
  margin: 3rem auto 4rem auto;
  padding: 0 2rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.category-card {
  height: 160px;            /* uniform card height */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--color-surface) 0%, #f8fafc 100%);
  border: 2px solid rgba(220,38,38,0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-primary);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.category-card:hover::before,
.category-card:focus::before {
  transform: scaleX(1);
}

.category-card:hover,
.category-card:focus {
  transform: translateY(-8px);
  box-shadow: var(--shadow-red);
  border-color: var(--color-red-light);
}

/* ===== Filter Sidebar (inside product view) ===== */
.filter-sidebar {
  width: 220px;
  flex: 0 0 220px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%);
  border-right: 2px solid rgba(220,38,38,0.08);
  padding: 1.5rem 1rem;
  /* Keep filters visible while scrolling the product list */
  position: sticky;
  top: 64px;              /* accounts for header height (sticky header) */
  max-height: calc(100vh - 64px);   /* ensure sidebar doesn't extend past viewport */
  overflow-y: auto;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.filter-sidebar .back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(220,38,38,0.05) 0%, rgba(239,68,68,0.05) 100%);
  border: 2px solid rgba(220,38,38,0.1);
  color: var(--color-primary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: 100%;
}
.filter-sidebar .back-btn:hover {
  background: linear-gradient(135deg, rgba(220,38,38,0.1) 0%, rgba(239,68,68,0.1) 100%);
  border-color: var(--color-secondary);
  transform: translateX(-2px);
}

.filter-sidebar input[type="search"] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 2px solid rgba(220,38,38,0.15);
  border-radius: 8px;
  background: white;
  transition: all 0.2s ease;
}
.filter-sidebar input[type="search"]:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

@media (max-width: 700px) {
  .filter-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.modal-window {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 2rem 2.5rem;
  max-width: 700px;
  width: 90%;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 63, 112, 0.4);
  border: 1px solid rgba(255,255,255,0.5);
  position: relative;
  animation: fadeSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Ensure modal never exceeds viewport height and scrolls internally if content is long */
  max-height: 90vh;
  overflow-y: auto;
}
.modal-window .close,
.modal-window .print-btn {
  position: absolute;
  top: 1rem;
  border: none;
  background: rgba(220,38,38,0.05);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.modal-window .close {
  right: 1rem;
}
.modal-window .close:hover {
  background: rgba(220,38,38,0.1);
  color: var(--color-secondary);
  transform: scale(1.1);
}
.modal-window .print-btn {
  right: 3.5rem;
  color: var(--color-primary);
}
.modal-window .print-btn:hover {
  background: rgba(220,38,38,0.1);
  color: var(--color-secondary);
  transform: scale(1.1);
}

.modal-window h2 {
  margin: 0 0 0.75rem 0;
  font-size: 1.4rem;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 0.25rem;
}
.modal-window p {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  line-height: 1.35rem;
}

.modal-window table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
}
.modal-window th,
.modal-window td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(220,38,38,0.08);
  text-align: left;
}
.modal-window th {
  background: linear-gradient(135deg, rgba(220,38,38,0.08) 0%, rgba(2,132,199,0.08) 100%);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

/* Zebra striping for modal item table */
.modal-window tbody tr:nth-child(odd) {
  background: rgba(248,250,252,0.5);
}
.modal-window tbody tr:hover {
  background: rgba(2,132,199,0.08);
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem 2rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(252,165,165,0.08) 100%);
  border-radius: 20px;
  margin: 2rem auto;
  max-width: 1200px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(220,38,38,0.1);
}

.hero h1 {
  margin: 0 0 1.5rem 0;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  color: var(--color-text-light);
  line-height: 1.7;
  font-weight: 400;
}

/* Cart Drawer */
.cart-drawer {
  position: fixed !important;
  right: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 1000 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  pointer-events: none;
}

.cart-drawer > * {
  pointer-events: auto;
}

.cart-drawer .drawer-content {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border: 2px solid rgba(220,38,38,0.2);
  border-right: none;
  padding: 1.5rem;
  width: 340px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: -6px 0 24px rgba(220,38,38,0.15);
  border-radius: 16px 0 0 16px;
}

.cart-drawer .drawer-content h2 {
  margin-top: 0;
  color: var(--color-primary);
  font-size: 1.3rem;
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.cart-drawer .drawer-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.cart-drawer .drawer-content li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: rgba(220,38,38,0.03);
  border: 1px solid rgba(220,38,38,0.1);
  border-radius: 8px;
}

.cart-drawer .drawer-content input[type="number"] {
  padding: 0.5rem;
  border: 2px solid rgba(220,38,38,0.15);
  border-radius: 6px;
  font-size: 0.9rem;
  width: 80px;
}

.cart-drawer .drawer-content input[type="text"],
.cart-drawer .drawer-content input[type="number"]:not([type="number"][min]) {
  padding: 0.65rem;
  border: 2px solid rgba(220,38,38,0.15);
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
  margin-top: 0.5rem;
}

.cart-drawer .drawer-content input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.cart-drawer .drawer-content button {
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  width: 100%;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cart-drawer .drawer-content button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

.cart-drawer .drawer-content button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cart-drawer .drawer-content li button {
  width: auto;
  margin: 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  align-self: flex-end;
  background: linear-gradient(135deg, #c62828 0%, #ef4444 100%);
}

/* ===== Mobile Responsive Styles ===== */
@media (max-width: 768px) {
  .cart-drawer .drawer-content {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    border-left: none;
    border-top: 2px solid rgba(220,38,38,0.2);
  }
  
  .cart-drawer:not(.open) .toggle-btn {
    right: 10px;
    top: auto;
    bottom: 20px;
    transform: none;
    writing-mode: horizontal-tb;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
  }
  
  .cart-drawer.open .toggle-btn {
    position: relative;
    border-radius: 8px;
  }
  
  .cart-drawer {
    top: auto !important;
    bottom: 0 !important;
    transform: none !important;
    left: 0;
    right: 0;
  }
  
  /* Make hero text smaller on mobile */
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  /* Adjust product cards for mobile */
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
  }
  
  /* Stack category cards on mobile */
  .category-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
    gap: 1rem;
  }
  
  .category-card {
    height: 120px;
  }
  
  /* Adjust admin panels for mobile */
  .admin-panel,
  .account-page,
  .order-page,
  .cart-page {
    padding: 1.5rem 1rem;
    margin: 1rem;
    border-radius: 12px;
  }
  
  /* Make tables scrollable on mobile */
  .admin-panel table,
  .account-page table,
  .order-page table,
  .cart-page table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Adjust login page for mobile */
  .login-page {
    margin: 2rem 1rem;
    padding: 2rem 1.5rem;
  }
  
  /* Modal adjustments for mobile */
  .modal-window {
    width: 95%;
    max-height: 85vh;
    padding: 1.5rem 1.25rem;
    border-radius: 16px;
  }
  
  /* Toolbar adjustments */
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .toolbar input[type="search"],
  .toolbar select {
    width: 100%;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .hero {
    padding: 2rem 1rem;
    margin: 1rem;
  }
  
  .hero h1 {
    font-size: 1.5rem;
  }
  
  .hero p {
    font-size: 0.95rem;
  }
  
  .product {
    padding: 1rem;
  }
  
  .category-card {
    height: 100px;
    font-size: 1rem;
  }
  
  header {
    padding: 0.5rem;
  }
  
  header img {
    height: 32px;
  }
}

.cart-drawer .toggle-btn {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
}

.cart-drawer:not(.open) .toggle-btn {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 8px 0 0 8px;
}

.cart-drawer.open .toggle-btn {
  transform: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 0;
}

.cart-drawer .toggle-btn:hover {
  box-shadow: var(--shadow-red);
}

/* ===== Admin Panel Styling ===== */
.admin-panel {
  max-width: 1100px;
  margin: 2rem auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 2.5rem 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(220,38,38,0.08);
}

.admin-panel section {
  margin-bottom: 2.5rem;
}

.admin-panel h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  text-align: center;
}

.admin-panel h2 {
  font-size: 1.25rem;
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

.admin-panel h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.admin-panel table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.admin-panel th,
.admin-panel td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(220,38,38,0.08);
  text-align: left;
}
.admin-panel th {
  background: linear-gradient(135deg, rgba(220,38,38,0.05) 0%, rgba(239,68,68,0.05) 100%);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.admin-panel input,
.admin-panel select,
.admin-panel button {
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  border: 2px solid rgba(220,38,38,0.15);
  border-radius: 8px;
}

.admin-panel input:focus,
.admin-panel select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
  background: white;
}

.admin-panel button {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.admin-panel button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(185,28,28,0.3) 0%, rgba(220,38,38,0.3) 100%);
  transition: left 0.3s ease;
}
.admin-panel button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}
.admin-panel button:hover::before {
  left: 0;
}

.admin-panel select {
  background: #fff;
}

.admin-panel ul {
  list-style: none;
  padding: 0;
}
.admin-panel ul li {
  margin-bottom: 0.25rem;
}

/* ===== Badge helpers ===== */
.badge {
  display: inline-block;
  padding: 0.35em 0.9em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 2px solid transparent;
}
.badge.draft {
  background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
  color: #424242;
  border-color: rgba(66,66,66,0.1);
}
.badge.quote {
  background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(66,165,245,0.3);
}
.badge.pending {
  background: linear-gradient(135deg, #ffb74d 0%, #ffa726 100%);
  color: #482900;
  box-shadow: 0 2px 8px rgba(255,183,77,0.3);
}
.badge.in_progress {
  background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(66,165,245,0.3);
}
.badge.completed {
  background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(76,175,80,0.3);
}
.badge.shipped {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(76,175,80,0.4);
}
.badge.partial_shipped {
  background: linear-gradient(135deg, #81c784 0%, #66bb6a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(129,199,132,0.3);
}
.badge.backordered {
  background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(229,57,53,0.3);
}
.badge.cancelled {
  background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(158,158,158,0.3);
}

/* ===== Admin table row zebra & hover ===== */
.admin-panel tbody tr:nth-child(odd) {
  background: rgba(248,250,252,0.5);
}
.admin-panel tbody tr:hover {
  background: rgba(239,68,68,0.05);
  transform: scale(1.001);
  box-shadow: 0 2px 8px rgba(220,38,38,0.08);
}

/* ===== Order Meta Grid ===== */
.order-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1.25rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.order-meta .label {
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .order-meta {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Login Page Styling ===== */
.login-page {
  max-width: 460px;
  margin: 4rem auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 3rem 3rem;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(220,38,38,0.08);
  text-align: center;
}

.login-page img {
  height: 40px;
  margin-bottom: 1rem;
}

.login-page h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 0.35rem;
  margin-bottom: 1.5rem;
}

.login-page form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-page label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  text-align: left;
}

.login-page input {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(0,63,112,0.15);
  border-radius: 10px;
  font-size: 0.95rem;
  background: white;
  transition: all 0.2s ease;
}

.login-page input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 4px rgba(220,38,38,0.1);
  transform: translateY(-1px);
}

.login-page button {
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.login-page button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

.login-page .error-msg {
  color: #d32f2f;
  font-size: 0.85rem;
  margin: 0;
}

@media print {
  .no-print { display: none !important; }
  .only-print { display: inline !important; }
}

/* ===== Account Page Styling ===== */
.account-page {
  max-width: 1100px;
  margin: 2rem auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 2.5rem 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(220,38,38,0.08);
}

.account-page section {
  margin-bottom: 2.5rem;
}

.account-page h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  text-align: center;
}

.account-page h2 {
  font-size: 1.25rem;
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

.account-page h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.account-page table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}
.account-page th,
.account-page td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(220,38,38,0.08);
  text-align: left;
}
.account-page th {
  background: linear-gradient(135deg, rgba(220,38,38,0.05) 0%, rgba(239,68,68,0.05) 100%);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}
.account-page tbody tr:nth-child(odd) {
  background: rgba(248,250,252,0.5);
}
.account-page tbody tr:hover {
  background: rgba(239,68,68,0.05);
  transform: scale(1.001);
}

/* Address list */
.address-list {
  list-style: none;
  padding: 0;
}

.address-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid rgba(220,38,38,0.1);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.address-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-red-light);
  transform: translateX(4px);
}
.address-card strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
  font-size: 1.05rem;
  font-weight: 700;
}
.address-card pre {
  white-space: pre-wrap;
  margin: 0;
}
.address-card button {
  margin-top: 0.5rem;
}

/* Address form grid */
.address-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .address-form {
    grid-template-columns: 1fr;
  }
}

/* Button helpers */
.btn-danger {
  background: linear-gradient(135deg, #c62828 0%, #ef4444 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #b71c1c 0%, #dc2626 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== Order Page Styling ===== */
.order-page {
  max-width: 1100px;
  margin: 2rem auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 2.5rem 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(220,38,38,0.08);
}

.order-page section {
  margin-bottom: 2rem;
}

.order-page h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  text-align: center;
}

.order-page h2 {
  font-size: 1.25rem;
  border-bottom: 2px solid var(--color-secondary);
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
}

.order-page table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.order-page th,
.order-page td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(220,38,38,0.08);
  text-align: left;
}

.order-page th {
  background: linear-gradient(135deg, rgba(220,38,38,0.05) 0%, rgba(239,68,68,0.05) 100%);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.order-page tbody tr:nth-child(odd) {
  background: rgba(248,250,252,0.5);
}
.order-page tbody tr:hover {
  background: rgba(239,68,68,0.05);
  transform: scale(1.001);
}

/* Address input grid reused from account page */
.order-page .address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .order-page .address-grid {
    grid-template-columns: 1fr;
  }
}

/* Generic button styling (reuse primary brand colors) */
.order-page .btn {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.order-page .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

/* ===== Cart Page Styling ===== */
.cart-page {
  max-width: 1100px;
  margin: 2rem auto;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 2.5rem 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(220,38,38,0.08);
}

.cart-page h1 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  text-align: center;
}

.cart-page .items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.cart-page th,
.cart-page td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(220,38,38,0.08);
  text-align: left;
}

.cart-page th {
  background: linear-gradient(135deg, rgba(220,38,38,0.05) 0%, rgba(239,68,68,0.05) 100%);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.cart-page tbody tr:nth-child(odd) {
  background: rgba(248,250,252,0.5);
}
.cart-page tbody tr:hover {
  background: rgba(239,68,68,0.05);
  transform: scale(1.001);
}

/* Totals panel */
.cart-page .totals {
  margin-top: 1rem;
  text-align: right;
  max-width: 20rem;
  margin-left: auto;
}
.cart-page .totals table {
  width: 100%;
}
.cart-page .totals td {
  padding: 0.25rem 0;
}
.cart-page .totals td:last-child {
  text-align: right;
}

/* Inputs */
.cart-page .qty-input {
  width: 90px;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  border: 2px solid rgba(0,63,112,0.15);
  border-radius: 8px;
  background: white;
  transition: all 0.2s ease;
  font-weight: 600;
}
.cart-page .qty-input:focus,
.cart-page .po-input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}
.cart-page .po-input {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  width: 100%;
  max-width: 20rem;
  font-size: 0.95rem;
  border: 2px solid rgba(0,63,112,0.15);
  border-radius: 10px;
  background: white;
  transition: all 0.2s ease;
}

/* Buttons inside cart page */
.cart-page .btn {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.cart-page .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

/* === Toast Notifications === */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-end;
}

.toast {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 320px;
  box-shadow: var(--shadow-red);
  border: 1px solid rgba(255,255,255,0.2);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  /* Ensure it is above other content but below modal overlays */
  z-index: 100;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===== Pagination Styling ===== */
.pagination button {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.pagination button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-red);
}

.pagination button:disabled {
  background: linear-gradient(135deg, #9e9e9e 0%, #bdbdbd 100%);
  cursor: not-allowed;
  opacity: 0.6;
}

.pagination span {
  font-weight: 600;
  color: var(--color-primary);
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.8);
  border-radius: 8px;
  border: 2px solid rgba(220,38,38,0.1);
}

/* ===== General Button Enhancements ===== */
button {
  font-family: var(--font-body);
}

button:not(:disabled) {
  cursor: pointer;
}

/* ===== Add to Cart / Quote Buttons ===== */
.add-btn,
button.add-btn {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.add-btn:hover,
button.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, #b91c1c 0%, var(--color-secondary) 100%);
}

/* ===== Product Image Styling ===== */
.product img {
  border-radius: 8px;
  background: white;
  padding: 0.5rem;
}

/* ===== Section Titles ===== */
section > h2:first-child {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
} 