:root {
  --brand-primary: #6c5ce7;
  --brand-primary-2: #7f5af0;
  --brand-dark: #1f2937;
  --brand-muted: #64748b;
  --surface: #ffffff;
  --surface-soft: #f7f8fb;
  --border-soft: #e5e7eb;
  --shadow-soft: 0 10px 30px rgba(31, 41, 55, 0.08);
  --shadow-hover: 0 20px 45px rgba(31, 41, 55, 0.16);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-fast: 160ms;
  --motion-slow: 320ms;
}

body {
  background: linear-gradient(180deg, #f9fafc 0%, #f4f6fb 100%);
  color: var(--brand-dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.1px;
}

a {
  color: var(--brand-primary);
  text-decoration: none;
}

a:hover {
  color: #5a4cd6;
}

#top {
  background: #0f172a;
}

#top a,
#top .dropdown-toggle {
  color: #e2e8f0;
}

#top a:hover,
#top .dropdown-toggle:hover {
  color: #ffffff;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 0 8px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

header .row {
  align-items: center;
}

#logo img {
  max-height: 56px;
  height: auto;
  width: auto;
  display: block;
}

#logo a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#cart .btn,
#cart button {
  border-radius: 999px;
}

.form-control,
.form-select,
.btn {
  border-radius: var(--radius-sm);
  transition: all var(--motion-fast) var(--ease-out);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(108, 92, 231, 0.2);
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-2));
  box-shadow: 0 8px 18px rgba(108, 92, 231, 0.35);
  font-weight: 600;
  transform: translateY(0);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a4cd6, #6a54e6);
  box-shadow: 0 10px 24px rgba(108, 92, 231, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(108, 92, 231, 0.35);
}

.btn-light {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.card,
.product-thumb,
.category-card,
.accordion,
.table {
  border-radius: var(--radius-lg);
}

.card,
.product-thumb {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}

.card .card-header,
.accordion-button {
  background: #f8fafc;
  font-weight: 700;
}

.card:hover,
.product-thumb:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.breadcrumb {
  background: transparent;
  padding: 0.75rem 0;
  font-size: 0.95rem;
  color: var(--brand-muted);
}

.breadcrumb a {
  color: var(--brand-muted);
}

.breadcrumb a:hover {
  color: var(--brand-primary);
}

.alert {
  border-radius: var(--radius-md);
}

/* Premium layout helpers */
.container {
  max-width: 1240px;
}

main > .container {
  padding-top: 20px;
  padding-bottom: 30px;
}

/* Navigation menu */
#menu {
  background: #111827;
  border-radius: var(--radius-lg);
  margin: 14px auto 18px;
  box-shadow: var(--shadow-soft);
}

#menu .nav-link,
#menu .dropdown-toggle {
  color: #e5e7eb;
  font-weight: 600;
}

#menu .nav-link:hover,
#menu .dropdown-toggle:hover {
  color: #ffffff;
}

#menu .dropdown-menu {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

#menu .nav-link.active,
#menu .dropdown-toggle.active {
  color: #ffffff;
  position: relative;
}

#menu .nav-link.active::after,
#menu .dropdown-toggle.active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -8px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-2));
  border-radius: 999px;
}

/* Product grid polish */
.product-thumb .image img {
  border-radius: var(--radius-md);
}

.product-thumb .caption h4 a,
.product-thumb .caption h4 {
  font-weight: 700;
  color: var(--brand-dark);
}

.product-thumb .price {
  color: var(--brand-primary);
  font-weight: 700;
}

.product-thumb .button-group .btn {
  border-radius: 999px;
  transition: transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease-out);
}

.product-thumb .button-group .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(31, 41, 55, 0.12);
}

/* Category tiles */
.category-card {
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.category-card h5 {
  font-weight: 700;
}

/* Tables */
.table {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-soft);
  font-weight: 700;
}

/* Section animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form sections */
fieldset,
.accordion-item,
.card {
  border: 1px solid var(--border-soft);
}

fieldset {
  background: var(--surface);
  padding: 18px;
  border-radius: var(--radius-lg);
}

/* Inputs grouping */
.input-group .btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Badges & labels */
.badge {
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
}

/* Images */
img {
  image-rendering: auto;
}

/* Footer polish */
footer {
  margin-top: 40px;
}

footer h5 {
  color: #e2e8f0;
  font-weight: 700;
}

/* Checkout sidebar polish */
#checkout-confirm,
#checkout-shipping-method,
#checkout-payment-method {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  animation: fadeUp var(--motion-slow) var(--ease-out) both;
}

.card,
.product-thumb,
.category-card,
.table,
fieldset {
  animation: fadeUp var(--motion-slow) var(--ease-out) both;
}

/* Search polish */
#search .form-control {
  background: #ffffff;
  border: 1px solid #e6e8ef;
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.06);
}

#search .btn {
  box-shadow: 0 8px 18px rgba(108, 92, 231, 0.25);
}

/* Search page layout fix */
#product-search #product-list {
  display: flex !important;
  flex-wrap: wrap;
  width: auto;
  margin-left: -12px;
  margin-right: -12px;
}

#product-search #product-list > .col {
  padding-left: 12px;
  padding-right: 12px;
}

.accordion-button {
  border-radius: var(--radius-md);
}

.dr-header-banner__img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

footer {
  background: #0f172a;
  color: #cbd5f5;
  padding-top: 24px;
}

footer a {
  color: #cbd5f5;
}

footer a:hover {
  color: #ffffff;
}

@media (max-width: 992px) {
  #logo {
    margin-bottom: 12px;
  }

  #menu {
    margin: 10px 0 16px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px 0 6px;
  }

  #cart {
    margin-top: 8px;
  }

  #checkout-confirm,
  #checkout-shipping-method,
  #checkout-payment-method {
    position: static;
    padding: 12px;
  }

  .row {
    margin-left: -8px;
    margin-right: -8px;
  }

  .row > [class*="col"] {
    padding-left: 8px;
    padding-right: 8px;
  }

  .input-group {
    flex-wrap: wrap;
  }

  .input-group .form-select,
  .input-group .form-control,
  .input-group .btn {
    width: 100%;
    border-radius: var(--radius-sm) !important;
  }

  .btn-group {
    flex-wrap: wrap;
    gap: 6px;
  }

  .product-thumb {
    margin-bottom: 16px;
  }

  fieldset {
    padding: 14px;
  }

  .card,
  .product-thumb {
    border-radius: 14px;
  }

  #payment-methods-inline .form-check,
  #shipping-methods-inline .form-check {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  #payment-methods-inline .form-check-label,
  #shipping-methods-inline .form-check-label {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
