:root {
  --primary-color: #0d6efd;
  --primary-hover: #0b5ed7;
  --danger-color: #dc3545;
  --danger-hover: #a71d2a;
  --success-color: #198754;

  /* Backgrounds */
  --bg-color: #1a1a1a;
  --bg-surface: #2c2c2c;
  --bg-surface-2: #3a3a3a;
  --bg-gradient: radial-gradient(
    circle,
    rgba(63, 63, 63, 1) 0%,
    rgba(26, 26, 26, 1) 100%
  );

  /* Text */
  --text-color: #f0f0f0;
  --text-muted: #aaa;
  --text-dark: #1a1a1a;

  /* Glassmorphism */
  --glass-bg: rgba(44, 44, 44, 0.65);
  --glass-bg-header: rgba(30, 30, 30, 0.75);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(10px);

  /* Sidebar */
  --sidebar-bg: #212529;
  --sidebar-text: #f0f0f0;
  --sidebar-text-muted: #aaa;
  --sidebar-border: #000;
  --sidebar-logo-border: #555;
  --sidebar-hover-bg: #555;
  --sidebar-hover-text: #ffffff;
  --sidebar-logo-filter: invert(0);
  --sidebar-width: 250px;
  --header-height: 60px;
  --transition-speed: 0.3s;
}

/*  Colors: Light Theme  */
html.light-theme {
  --bg-color: #f4f7f6;
  --bg-surface: #ffffff;
  --bg-surface-2: #e9ecef;
  --bg-gradient: radial-gradient(
    circle,
    rgba(255, 255, 255, 1) 0%,
    rgba(244, 247, 246, 1) 100%
  );

  --text-color: #212529;
  --text-muted: #6c757d;

  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-header: rgba(248, 249, 250, 0.75);
  --glass-border: 1px solid rgba(0, 0, 0, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);

  /* Sidebar Light Theme */
  --sidebar-bg: #ffffff;
  --sidebar-text: #212529;
  --sidebar-text-muted: #6c757d;
  --sidebar-border: #dee2e6;
  --sidebar-logo-border: #dee2e6;
  --sidebar-hover-bg: #e9ecef;
  --sidebar-hover-text: #000000;
  --sidebar-logo-filter: invert(1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Global Scrollbar Styles */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background-color: var(--bg-surface-2);
  border-radius: 6px;
  border: 3px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

/* Light Theme Scrollbar */
html.light-theme ::-webkit-scrollbar-track {
  background: #f4f7f6;
}

html.light-theme ::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-color: #f4f7f6;
}

html.light-theme ::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.5em 1em;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all var(--transition-speed) ease;
}

/*  Primary Button Style  */
button.primary {
  background: rgba(13, 110, 253, 0.7);
  color: white;
  border: 1px solid rgba(13, 110, 253, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
button.primary:hover {
  background: rgba(11, 94, 215, 0.9);
  border-color: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

button.danger {
  background-color: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}
button.danger:hover {
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover);
}

input,
textarea,
select {
  background: var(--bg-surface-2);
  color: var(--text-color);
  border: var(--glass-border);
  padding: 0.5rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease,
    color 0.3s ease;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-hover);
}
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23aaa%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.2em;
  padding-right: 2rem;
}
html.light-theme select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%20fill%3D%22%23333%22/%3E%3C/svg%3E");
}
select:disabled {
  opacity: 0.5;
}

/*  Layout  */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  padding: 1rem;
  transform: translateX(0);
  transition: transform var(--transition-speed) ease-in-out,
    background-color 0.3s ease, color 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.3);
}

body:not(.sidebar-open) #sidebar {
  transform: translateX(-100%);
}

#main-content {
  padding-top: var(--header-height);
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed) ease-in-out;
}

body:not(.sidebar-open) #main-content {
  margin-left: 0;
}

.main-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 900;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.9), rgba(26, 26, 26, 0.85));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 2px solid rgba(13, 110, 253, 0.25);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

html.light-theme .main-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.92));
  border-bottom: 2px solid rgba(13, 110, 253, 0.15);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

body:not(.sidebar-open) .main-header {
  left: 0;
}

.main-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 1.5rem 0 0;
  color: var(--text-color);
  flex-shrink: 0;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.main-header h1.header-link a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}
.main-header h1.header-link a:hover {
  color: var(--primary-color);
  transform: translateX(2px);
}
html.light-theme .main-header h1 {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* User Menu Dropdown */
.user-menu {
  position: relative;
}

.user-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.user-icon-btn:hover {
  background: var(--bg-surface-2);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  font-size: 0.9rem;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-color);
  text-align: left;
  font-size: 0.9rem;
  transition: background 0.2s ease;
  border-radius: 0;
}

.dropdown-item:first-of-type {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.dropdown-item:last-of-type {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.dropdown-item:hover {
  background: var(--bg-surface-2);
}

.dropdown-item svg {
  flex-shrink: 0;
}

html.light-theme .user-dropdown {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

html.light-theme .user-dropdown-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#sidebar-toggle {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-color);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
#sidebar-toggle:hover {
  background: var(--bg-surface-2);
}

/* Cart Icon Button */
.cart-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-color);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.cart-icon-btn:hover {
  background: var(--bg-surface-2);
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--primary-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* AWD cart button */
.awd-cart-btn {
  border-radius: 8px;
  gap: 0.3rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255, 140, 0, 0.4);
  font-size: 0.75rem;
}
html.light-theme .awd-cart-btn {
  border-color: rgba(255, 140, 0, 0.5);
}
.awd-cart-btn:hover {
  background: rgba(255, 140, 0, 0.12) !important;
  border-color: rgba(255, 140, 0, 0.7);
}
.awd-cart-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgb(255, 140, 0);
  letter-spacing: 0.5px;
}
.awd-badge {
  background: rgb(255, 140, 0) !important;
}

/* AWD cart modal */
.awd-cart-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
html.light-theme .awd-cart-modal {
  background: rgba(0, 0, 0, 0.4);
}
.awd-cart-modal.open {
  display: flex;
}
.awd-cart-content {
  max-width: 550px;
}
.awd-cart-header {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 100, 0, 0.1)) !important;
  border-bottom: 1px solid rgba(255, 140, 0, 0.3) !important;
}
.awd-cart-header h2 {
  color: rgb(255, 140, 0);
}
.awd-min-warning {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* AWD warning modal */
.awd-warning-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.awd-warning-modal.open {
  display: flex;
}
.awd-warning-content {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 140, 0, 0.4);
  border-radius: 16px;
  padding: 2rem;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.awd-warning-content h3 {
  color: rgb(255, 140, 0);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}
.awd-warning-content p {
  margin-bottom: 0.75rem;
  color: var(--text-color);
  font-size: 0.95rem;
}
.awd-warning-content ul {
  margin: 0.5rem 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.awd-warning-actions {
  display: flex;
  justify-content: flex-end;
}

.shop-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  gap: 1rem;
}

#current-category-title {
  margin: 0;
  color: var(--text-color);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-controls label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-controls select {
  background: var(--glass-bg);
  color: var(--text-color);
  border: var(--glass-border);
  border-radius: 8px;
  padding: 0.4em 2em 0.4em 0.75em;
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5em center;
  transition: border-color 0.15s;
}
.sort-controls select:focus {
  outline: none;
  border-color: var(--primary-color);
}
.sort-controls select:hover {
  border-color: var(--primary-color);
}
html.light-theme .sort-controls select {
  background-color: white;
  border-color: rgba(0,0,0,0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Sidebar */
.sidebar-logo {
  padding: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--sidebar-logo-border);
}
.sidebar-logo img {
  max-width: 33.5%;
  margin: 0 auto;
  filter: var(--sidebar-logo-filter);
  transition: filter 0.3s ease;
}
#sidebar h2 {
  color: var(--sidebar-text);
  padding: 0.75rem 0.75rem 0.5rem 0.75rem;
  font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}
#category-list ul {
  list-style: none;
  padding-left: 0;
  margin-top: 0;
}
#category-list .category-group {
  margin-bottom: 0.5rem;
}
#category-list .category-title {
  font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--sidebar-text);
  padding: 0.5rem 0.75rem;
  letter-spacing: 0.3px;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 6px;
}
#category-list .category-title:hover {
  background: rgba(13, 110, 253, 0.08);
}
#category-list .category-title .category-name {
  flex: 1;
}
#category-list .category-title .category-toggle {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  color: var(--text-muted);
  margin-left: 0.5rem;
}
#category-list .category-group.collapsed .category-toggle {
  transform: rotate(-90deg);
}
#category-list .category-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, var(--primary-color), var(--primary-hover));
  border-radius: 0 2px 2px 0;
  transition: height 0.3s ease;
}
#category-list .category-title:hover::before {
  height: 70%;
}
#category-list .subcategory-container {
  max-height: 2000px;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 1;
}
#category-list .category-group.collapsed .subcategory-container {
  max-height: 0;
  opacity: 0;
}
#category-list .subcategory-link {
  display: block;
  padding: 0.6rem 0.75rem 0.6rem 1.25rem;
  text-decoration: none;
  color: var(--sidebar-text-muted);
  border-radius: 6px;
  margin: 0.15rem 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.2px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
#category-list .subcategory-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(13, 110, 253, 0.15), transparent);
  transition: width 0.3s ease;
}
#category-list .subcategory-link::after {
  content: '›';
  position: absolute;
  right: 0.75rem;
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.25s ease;
  font-size: 1.1rem;
  color: var(--primary-color);
}
#category-list .subcategory-link:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-hover-text);
  padding-left: 1.5rem;
  transform: translateX(2px);
}
#category-list .subcategory-link:hover::before {
  width: 100%;
}
#category-list .subcategory-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}
#category-list .subcategory-link strong {
  color: var(--sidebar-text);
  font-weight: 500;
}

/* Article Grid  */
#article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.article-card {
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background-color 0.3s ease, border-color 0.3s ease;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px 0 rgba(0, 0, 0, 0.45);
  html.light-theme & {
    box-shadow: 0 12px 35px 0 rgba(31, 38, 135, 0.3);
  }
}

.article-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: default;
  height: 100%;
}

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background-color: rgba(58, 58, 58, 0.5);
  display: block;
  transition: background-color 0.3s ease;
  padding: 0.5rem;
}
html.light-theme .article-card img {
  background-color: #ffffff;
}

.article-card img.sorus-logo-fallback {
  filter: none;
  transition: filter 0.3s ease, background-color 0.3s ease;
}
html.light-theme .article-card img.sorus-logo-fallback {
  background-color: #2c2c2c;
  border-radius: 6px;
}

.article-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.article-card-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.article-card-content .description {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 1rem;
}

.article-card-content .article-sifra {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
  user-select: none;
  margin: 0.1rem 0 0.25rem;
}

.article-card-content .article-barcode {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.article-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  gap: 0.5rem;
}

.price-container {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.price.original {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.price.discounted {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--danger-color);
}
.price.normal {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--text-color);
}

.add-to-cart-controls {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  flex-shrink: 0;
}

.add-to-cart-controls .quantity-input-grid {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 0.82rem;
  text-align: center;
  -moz-appearance: textfield;
  box-sizing: border-box;
  border-radius: 6px;
}
.add-to-cart-controls .quantity-input-grid::-webkit-outer-spin-button,
.add-to-cart-controls .quantity-input-grid::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.add-to-cart-controls .add-to-cart-btn {
  height: 30px;
  padding: 0 0.65em;
  font-size: 0.82rem;
  line-height: 30px;
  box-sizing: border-box;
}

.qty-stepper-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
  background: var(--glass-bg);
  color: var(--text-color);
  border: var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  box-sizing: border-box;
}
.qty-stepper-btn:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/*  Cart Modal  */
#cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: all 0.3s ease;
}
html.light-theme #cart-modal {
  background: rgba(0, 0, 0, 0.4);
}

.cart-content {
  width: 90%;
  max-width: 650px;
  max-height: 90vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
              0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}
html.light-theme .cart-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
              0 0 0 1px rgba(0, 0, 0, 0.05);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgba(58, 58, 58, 0.8), rgba(45, 45, 45, 0.6));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
html.light-theme .cart-header {
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.9), rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cart-header h2 {
  font-size: 1.5rem;
}

#cart-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-muted);
}
#cart-close-btn:hover {
  color: var(--text-color);
}

#cart-items-container {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
  background: transparent;
}

.cart-item {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(58, 58, 58, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}
html.light-theme .cart-item {
  background: rgba(248, 249, 250, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.cart-item:hover {
  background: rgba(58, 58, 58, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
html.light-theme .cart-item:hover {
  background: rgba(248, 249, 250, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.cart-item:last-child {
  margin-bottom: 0;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(58, 58, 58, 0.5);
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}
html.light-theme .cart-item img {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.cart-item img[src$="/images/sorus.png"] {
  object-fit: contain;
  background-color: var(--bg-surface);
  filter: var(--sidebar-logo-filter);
  transition: filter 0.3s ease;
  html.light-theme & {
    background-color: var(--bg-color);
  }
}

.cart-item-info {
  flex-grow: 1;
}
.cart-item-info h4 {
  font-size: 1rem;
  margin: 0;
}
.cart-item-info .price {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cart-item-quantity button {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  background: rgba(58, 58, 58, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}
html.light-theme .cart-item-quantity button {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.cart-item-quantity button:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
}
.cart-item-quantity span {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
}

.cart-item-total {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: right;
  min-width: 80px;
  color: var(--primary-color);
}

.cart-summary {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(58, 58, 58, 0.8), rgba(45, 45, 45, 0.6));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
html.light-theme .cart-summary {
  background: linear-gradient(135deg, rgba(248, 249, 250, 0.95), rgba(255, 255, 255, 0.8));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.summary-line span:last-child {
  color: var(--text-color);
}
.summary-line.total {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}
html.light-theme .summary-line.total {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.summary-line.total span:last-child {
  color: var(--primary-color);
  font-size: 1.4rem;
}
#cart-discount-amount-total {
  color: var(--danger-color);
}

.cart-summary #checkout-btn {
  margin-top: 1.25rem;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: none;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
  transition: all 0.3s ease;
}
.cart-summary #checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}
.cart-summary #checkout-btn:active {
  transform: translateY(0);
}

/* Article Detail Page */
#article-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

#article-detail-image img {
  display: block;
  margin: 0 auto;
  width: auto;
  height: auto;
  max-width: 60%;
  max-height: 300px;
  object-fit: contain;
}
#article-detail-image img[src$="/images/sorus.png"] {
  filter: var(--sidebar-logo-filter);
  transition: filter 0.3s ease;
}
#article-detail-image {
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: rgba(58, 58, 58, 0.5);
  transition: background-color 0.3s ease;
}
html.light-theme #article-detail-image {
  background: rgba(233, 236, 239, 0.5);
}

#article-detail-info h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
#article-detail-info .description {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.article-codes {
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.article-codes span {
  display: inline-block;
  margin-right: 1.5rem;
}

.article-purchase-box {
  padding: 1.5rem;
  border-radius: 8px;
  background: var(--bg-surface-2);
  border: var(--glass-border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.article-purchase-box .price-container {
  margin-bottom: 1.5rem;
}
.article-purchase-box .price.original {
  font-size: 1.2rem;
}
.article-purchase-box .price.discounted {
  font-size: 2rem;
}
.article-purchase-box .price.normal {
  font-size: 2rem;
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.quantity-control label {
  font-size: 1.1rem;
  font-weight: bold;
}
.quantity-control input[type="number"] {
  width: 80px;
  font-size: 1.2rem;
  padding: 0.5rem;
  text-align: center;
}
.quantity-control input[type="number"]::-webkit-inner-spin-button,
.quantity-control input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.quantity-control input[type="number"] {
  -moz-appearance: textfield;
}

.article-purchase-box #add-to-cart-btn {
  width: 100%;
  font-size: 1.2rem;
  padding: 0.75rem;
}
#add-to-cart-success {
  color: var(--primary-color);
  text-align: center;
  margin-top: 1rem;
  display: none;
}

/* Admin Page Styles */
html.light-theme body.admin-page .admin-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 250, 0.9));
  border-bottom: 2px solid rgba(13, 110, 253, 0.2);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 900;
  background: linear-gradient(135deg, rgba(33, 37, 41, 0.95), rgba(26, 26, 26, 0.9));
  border-bottom: 2px solid rgba(13, 110, 253, 0.3);
  transition: all 0.3s ease;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}
.admin-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-color);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.admin-header a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.admin-header a:hover {
  background: rgba(13, 110, 253, 0.1);
  color: var(--primary-hover);
  text-decoration: none;
}

/* Admin Tab Navigation  */
.admin-tabs {
  display: flex;
  background: var(--bg-surface);
  padding: 0 2rem;
  gap: 0.5rem;
  position: sticky;
  top: var(--header-height);
  z-index: 899;
  border-bottom: 2px solid rgba(13, 110, 253, 0.15);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-link {
  padding: 1rem 1.8rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px 8px 0 0;
  position: relative;
  overflow: hidden;
}

.tab-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(13, 110, 253, 0.02));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.tab-link:hover::before {
  opacity: 1;
}

.tab-link:hover {
  color: var(--primary-color);
}

.tab-link.active {
  color: var(--primary-color);
  background: var(--glass-bg);
  border-bottom: 3px solid var(--primary-color);
  box-shadow: 0 -2px 8px rgba(13, 110, 253, 0.15);
}

.tab-link.active::before {
  opacity: 1;
}

html.light-theme .admin-tabs {
  background-color: var(--bg-surface);
  border-bottom: 2px solid rgba(13, 110, 253, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
html.light-theme .tab-link.active {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 -2px 8px rgba(13, 110, 253, 0.1);
}

/* Admin Tab Content */
.admin-content-area {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content .admin-section {
  margin-bottom: 2rem;
}
.tab-content .admin-section:last-child {
  margin-bottom: 0;
}

.admin-section {
  border-radius: 12px;
  padding: 2rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.admin-section:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.admin-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  border-bottom: 2px solid rgba(13, 110, 253, 0.3);
  padding-bottom: 0.75rem;
  letter-spacing: 0.3px;
}

html.light-theme .admin-section {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

html.light-theme .admin-section:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.12);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-color);
  letter-spacing: 0.2px;
}
.form-group input,
.form-group textarea,
.form-group select {
  border-radius: 6px;
  transition: all 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
.form-actions button {
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.form-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  overflow: hidden;
  border-radius: 8px;
}
.admin-table th,
.admin-table td {
  padding: 1rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(13, 110, 253, 0.1);
}
.admin-table th {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.15), rgba(13, 110, 253, 0.08));
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-color);
  border-bottom: 2px solid rgba(13, 110, 253, 0.3);
}
html.light-theme .admin-table th {
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.12), rgba(13, 110, 253, 0.06));
}
.admin-table tbody tr {
  transition: all 0.2s ease;
}
.admin-table tbody tr:hover {
  background: rgba(13, 110, 253, 0.05);
  transform: scale(1.01);
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table td:last-child {
  text-align: right;
}

.admin-table .action-btn {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4em 0.9em;
  margin-left: 0.3rem;
  border: 1.5px solid;
  background: transparent;
  color: var(--text-muted);
  border-radius: 5px;
  transition: all 0.2s ease;
}
.admin-table .action-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--text-muted);
  border-color: var(--text-muted);
}
.admin-table .edit-btn {
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.admin-table .edit-btn:hover:not([disabled]) {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(13, 110, 253, 0.3);
}
.admin-table .delete-btn {
  color: var(--danger-color);
  border-color: var(--danger-color);
}
.admin-table .delete-btn:hover:not([disabled]) {
  background: var(--danger-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
}

/* Login Page */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.login-logo {
  max-width: 60%;
  margin: 0 auto 1.5rem auto;
}
.login-logo img {
  display: block;
  margin: 0 auto;
  transition: filter 0.3s ease;
  filter: var(--sidebar-logo-filter);
}

.login-container h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}
.login-container .form-group {
  margin-bottom: 1rem;
}
.login-container .form-group label {
  color: var(--text-muted);
}
.login-container input {
  background: rgba(58, 58, 58, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}
html.light-theme .login-container input {
  background: rgba(233, 236, 239, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
}
.login-container button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.error-message {
  color: var(--danger-color);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 1rem;
  display: none;
  background-color: rgba(220, 53, 69, 0.1);
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Search Bar */
.search-form {
  display: flex;
  flex-grow: 1;
  margin-left: 1.5rem;
  margin-right: 1.5rem;
  max-width: 500px;
  position: relative;
}

.search-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  z-index: 1000;
  max-height: 420px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-color);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.15s;
}
.search-dropdown-item:last-child {
  border-bottom: none;
}
.search-dropdown-item:hover {
  background: var(--glass-bg);
}
.search-dropdown-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-surface-2);
}
.search-dropdown-item-info {
  flex: 1;
  min-width: 0;
}
.search-dropdown-item-info strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-dropdown-item-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.search-dropdown-price {
  font-size: 0.88rem;
  font-weight: bold;
  color: var(--primary-color);
  flex-shrink: 0;
}
.search-dropdown-empty {
  padding: 0.8rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
html.light-theme .search-dropdown {
  background: white;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
html.light-theme .search-dropdown-item:hover {
  background: #f5f5f5;
}

.search-form input[type="search"] {
  flex-grow: 1;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-surface);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.search-form input[type="search"]:focus {
  border-color: var(--primary-color);
  outline: none;
}
.search-form input[type="search"]::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
html.light-theme .search-form input[type="search"] {
  background: white;
  border-color: rgba(0, 0, 0, 0.35);
  color: #222;
}
html.light-theme .search-form input[type="search"]:focus {
  border-color: var(--primary-color);
}
html.light-theme .search-form input[type="search"]::placeholder {
  color: #888;
  opacity: 1;
}

@media (max-width: 900px) {
  .admin-main {
    grid-template-columns: 1fr;
  }
  .admin-tabs {
    flex-direction: column;
    padding: 0 1rem;
    top: calc(var(--header-height) - 1px);
  }
  .admin-content-area {
    padding: 1rem;
  }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Mobile search toggle button — hidden on desktop */
.mobile-search-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.mobile-search-btn:hover {
  background: var(--bg-surface-2);
}

/* Mobile search bar — hidden until toggled */
.mobile-search-bar {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 850;
  padding: 0.6rem 1rem;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  /* needed for dropdown absolute positioning */
  overflow: visible;
}
.mobile-search-bar input {
  width: 100%;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-color);
  font-size: 1rem;
}
.mobile-search-bar input:focus {
  outline: none;
  border-color: var(--primary-color);
}
html.light-theme .mobile-search-bar {
  background: #ffffff;
}
.mobile-search-bar.active {
  display: block;
}
#mobile-search-dropdown {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 860;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  /* Sidebar: always overlay on mobile, never push content */
  #sidebar {
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
  }
  #main-content {
    margin-left: 0 !important;
  }
  .main-header {
    left: 0 !important;
  }

  /* Show overlay when sidebar open on mobile */
  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  /* Header */
  .main-header {
    padding: 0 0.75rem;
  }
  .main-header h1 {
    font-size: 1.15rem;
    margin: 0 0.4rem;
  }
  .header-controls {
    gap: 0.4rem;
  }
  .user-info {
    display: none;
  }

  /* Hide desktop search, show mobile search icon */
  .search-form {
    display: none;
  }
  .mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
  }
  /* Push header-controls to right, search icon between title and controls */
  .main-header {
    display: flex;
    align-items: center;
  }
  .search-form + .header-controls {
    margin-left: auto;
  }

  /* Shop controls wrap on small screens */
  .shop-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  #current-category-title {
    font-size: 1.1rem;
  }

  /* Article grid — 1 column on mobile */
  #article-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0 0.25rem;
  }
  .article-card img {
    height: 130px;
  }
  .article-card-content {
    padding: 0.5rem;
  }
  .article-card-content h3 {
    font-size: 0.88rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .article-sifra {
    font-size: 0.7rem;
  }
  .price.normal,
  .price.discounted {
    font-size: 1rem;
  }
  .price.original {
    font-size: 0.78rem;
  }

  /* Card footer: stack vertically so controls always visible */
  .article-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .add-to-cart-controls {
    width: 100%;
    justify-content: space-between;
  }
  /* Touch targets — all same height */
  .qty-stepper-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  .add-to-cart-controls .quantity-input-grid {
    width: 36px;
    height: 36px;
    font-size: 0.88rem;
  }
  .add-to-cart-controls .add-to-cart-btn {
    height: 36px;
    line-height: 36px;
    flex: 1;
    padding: 0 0.5em;
    font-size: 0.85rem;
    min-width: 0;
  }

  /* Cart modal full screen on mobile */
  .cart-content {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }
  #cart-modal {
    align-items: flex-end;
  }
  .awd-cart-content {
    max-width: 100%;
    border-radius: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
  }
  .awd-cart-modal {
    align-items: flex-end;
  }

  /* Article detail */
  #article-detail-container {
    grid-template-columns: 1fr;
    padding: 1rem;
    margin: 1rem 0;
  }
  #article-detail-info h1 {
    font-size: 1.6rem;
  }

  /* Main content top padding when mobile search bar open */
  body.mobile-search-open #main-content {
    padding-top: calc(var(--header-height) + 56px);
  }
}

/* Tablet (769px – 1024px) — 2 columns */
@media (min-width: 769px) and (max-width: 1024px) {
  #article-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .article-card img {
    height: 160px;
  }
  .article-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .add-to-cart-controls {
    width: 100%;
    justify-content: space-between;
  }
  .qty-stepper-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .add-to-cart-controls .quantity-input-grid {
    width: 34px;
    height: 34px;
  }
  .add-to-cart-controls .add-to-cart-btn {
    height: 34px;
    line-height: 34px;
    flex: 1;
    padding: 0 0.5em;
  }
}

/*  Admin Form Styles */
.discount-fieldset {
  border: var(--glass-border);
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
}
.discount-fieldset legend {
  padding: 0 0.5rem;
}
#user-discounts-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.discount-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.discount-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/*  Cart Note Styles */
.cart-item-info .price-discount-note {
  font-size: 0.8rem;
  color: var(--danger-color);
  margin-left: 0.5rem;
}
.cart-item-total .price-original-note {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: normal;
  text-decoration: line-through;
}

/* Admin Button */
.header-btn {
  display: inline-block;
  font-size: 0.9rem;
  padding: 0.4em 0.8em;
  background: rgba(13, 110, 253, 0.7);
  color: white;
  border: 1px solid rgba(13, 110, 253, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  transition: all var(--transition-speed) ease;
}
.header-btn:hover {
  background: rgba(11, 94, 215, 0.9);
  border-color: var(--primary-hover);
  color: white;
}

/* Pagination Controls */
.scroll-sentinel {
  width: 100%;
  padding: 1rem 0 2rem;
  display: flex;
  justify-content: center;
}
.scroll-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Sidebar Scrollbar */
#sidebar::-webkit-scrollbar {
  width: 8px;
}
#sidebar::-webkit-scrollbar-track {
  background: var(--sidebar-bg);
  transition: background-color 0.3s ease;
}
#sidebar::-webkit-scrollbar-thumb {
  background-color: var(--bg-surface-2);
  border-radius: 10px;
  border: 2px solid var(--sidebar-bg);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
html.light-theme #sidebar::-webkit-scrollbar-thumb {
  border-color: var(--sidebar-bg);
  background-color: #ccc;
}
#sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

/* Checkout Page Styles */
.checkout-page #cart-toggle {
  opacity: 0.5;
  cursor: not-allowed;
}
.glassmorphism-container {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
  padding: 2rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.checkout-container {
  max-width: 800px;
  margin: 2rem auto;
}
.checkout-container h2 {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Checkout Summary Table  */
#checkout-summary table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  display: table;
}
#checkout-summary thead {
  display: table-header-group;
}
#checkout-summary tbody {
  display: table-row-group;
}
#checkout-summary tfoot {
  display: table-footer-group;
}
#checkout-summary tr {
  display: table-row;
}
#checkout-summary th,
#checkout-summary td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  display: table-cell;
  vertical-align: middle;
  transition: border-color 0.3s ease;
}
#checkout-summary th {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
}
#checkout-summary th:first-child,
#checkout-summary td:first-child {
  padding-left: 0;
  padding-right: 0.5rem;
  width: 60px;
  text-align: center;
}
#checkout-summary td img {
  vertical-align: middle;
  max-width: 50px;
  max-height: 50px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg-surface-2);
}
#checkout-summary td.item-name {
  font-weight: bold;
}
#checkout-summary td.price,
#checkout-summary td.quantity,
#checkout-summary td.total,
#checkout-summary th:nth-child(3),
#checkout-summary th:nth-child(4),
#checkout-summary th:nth-child(5) {
  text-align: right;
}
#checkout-summary td.price .original {
  display: block;
  font-size: 0.8em;
  color: var(--text-muted);
  text-decoration: line-through;
}
#checkout-summary td.price .discounted {
  color: var(--danger-color);
}
#checkout-summary tfoot td {
  font-weight: bold;
  border-top: 2px solid var(--text-muted);
}
html.light-theme #checkout-summary tfoot td {
  border-top-color: var(--border-color);
}
#checkout-summary tfoot tr:last-child td {
  font-size: 1.2em;
  color: var(--text-color);
}
#checkout-summary tfoot #summary-discount-amount {
  color: var(--danger-color);
}

.checkout-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
}
.button.secondary {
  padding: 0.5em 1em;
  background-color: var(--bg-surface-2);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  font-size: 1rem;
  transition: all var(--transition-speed) ease;
}
.button.secondary:hover {
  background-color: var(--bg-surface);
  border-color: var(--text-muted);
}

/* Checkout Shipping Form Styles  */
.checkout-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}
#shipping-display-and-form h4 {
  margin-bottom: 1rem;
  color: var(--text-muted);
}
.address-display-block {
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.address-display-block p {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.address-display-block p strong {
  color: var(--text-muted);
  min-width: 70px;
  display: inline-block;
}
.address-display-block p span {
  color: var(--text-color);
}
.address-display-block small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85em;
  color: var(--text-muted);
  text-align: right;
}
.form-group.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.form-group.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-top: 2px;
  accent-color: var(--primary-color);
  cursor: pointer;
}
.form-group.checkbox-group label {
  margin-bottom: 0;
  font-weight: normal;
  color: var(--text-color);
  cursor: pointer;
}
#alternate-address-form {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-color);
}
#alternate-address-form textarea {
  min-height: 60px;
  resize: vertical;
}

/* Order Confirmation Modal  */
#confirmation-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
#confirmation-modal-overlay.visible {
  display: flex;
  opacity: 1;
}
#confirmation-modal-content {
  max-width: 450px;
  width: 90%;
  text-align: center;
  padding: 2.5rem;
  transform: translateY(-20px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
html.light-theme #confirmation-modal-content {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
}

#confirmation-modal-overlay.visible #confirmation-modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem auto;
}
.modal-icon svg {
  width: 100%;
  height: 100%;
}
.modal-icon svg circle {
  fill: #4caf50;
}
.modal-icon svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 3;
}
#confirmation-modal-content h2 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 2rem;
}
#confirmation-modal-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Admin Edit Button on Article Page */
.admin-edit-button-container {
  max-width: 1100px;
  margin: 1.5rem auto 0 auto;
  padding: 0 2rem 1rem 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: sticky;
  top: calc(var(--header-height) + 0.5rem);
  z-index: 100;
  pointer-events: none;
}
.admin-edit-button-container button {
  pointer-events: auto;
}
#page-edit-article-btn {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
#page-edit-article-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
#page-edit-article-btn:active {
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

/* Edit Article Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  opacity: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.3s ease;
}
html.light-theme .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}
.modal-overlay.visible {
  display: flex;
  opacity: 1;
}

.edit-modal-content {
  width: 90%;
  max-width: 750px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  opacity: 0;
  transform: translateY(-20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: rgba(30, 30, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
html.light-theme .edit-modal-content {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.modal-overlay.visible .edit-modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
html.light-theme .modal-close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.modal-close-btn:hover {
  color: white;
  background: var(--danger-color);
  border-color: var(--danger-color);
  transform: scale(1.05);
}

.edit-modal-content h2 {
  margin-bottom: 1.75rem;
  margin-top: 0;
  border-bottom: 2px solid rgba(13, 110, 253, 0.3);
  padding-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.edit-modal-content h2::before {
  content: '✏️';
  font-size: 1.3rem;
}

.edit-modal-content .admin-form {
  margin-bottom: 0;
}

/*  Batch Upload Status Modal  */
#batch-status-modal-content {
  max-width: 700px;
  text-align: center;
}
html.light-theme #batch-status-modal-content {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
}

#batch-errors-wrapper,
#batch-categories-wrapper {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: left;
}

#batch-errors-list,
#batch-categories-list {
  list-style-position: inside;
  padding-left: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-color);
}

#batch-errors-list li {
  color: var(--danger-color);
  margin-bottom: 0.5rem;
}

/* - General Status Modal (for User, Article, Category)  */
#status-modal-content {
  max-width: 450px;
  text-align: center;
}
html.light-theme #status-modal-content {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.15);
}
/* Register Page Styles  */
.register-link-container {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Success message on login/register */
.success-message {
  color: var(--success-color);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 1rem;
  display: none;
  background-color: rgba(25, 135, 84, 0.1);
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(25, 135, 84, 0.3);
}
/* Admin Send Email Button */
#send-email-btn {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: white;
  font-weight: 500;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#send-email-btn:hover {
  background-color: #157347;
  border-color: #157347;
}

#send-email-btn:disabled {
  background-color: var(--success-color);
  border-color: var(--success-color);
  opacity: 0.6;
  cursor: not-allowed;
}

#email-send-status {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
#email-send-status p {
  padding: 0;
  margin: 0;
}
