:root {
    --bg: #fafafa;
    --card: #ffffff;
    --ink: #0a0a0a;
    --muted: #737373;
    --accent: #dc2626;
    --accent-hover: #b91c1c;
    --accent-soft: rgba(220, 38, 38, 0.1);
    --radius-lg: 1.25rem;
    --radius-md: 1rem;
    --shadow-sm: 0 10px 30px rgba(220, 38, 38, 0.08);
    --shadow-card: 0 4px 16px rgba(220, 38, 38, 0.12);
    --border: rgba(220, 38, 38, 0.1);
    --input-bg: #f5f5f5;
    --input-border: rgba(0,0,0,0.08);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  [data-theme="dark"] {
    --bg: #0f0f0f;
    --card: #1c1c1c;
    --ink: #f5f5f5;
    --muted: #a8a8a8;
    --accent: #f43f5e;
    --accent-hover: #fb7185;
    --accent-soft: rgba(244, 63, 94, 0.15);
    --shadow-sm: 0 10px 30px rgba(0,0,0,0.6);
    --shadow-card: 0 6px 20px rgba(244, 63, 94, 0.25);
    --border: rgba(244, 63, 94, 0.25);
    --input-bg: #262626;
    --input-border: rgba(244, 63, 94, 0.3);
  }
  
  * {
    box-sizing: border-box;
  }

  html {
    overflow-x: hidden;
    width: 100%;
  }

  /* Smooth theme transitions */
  *,
  *::before,
  *::after {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease,
                fill 0.3s ease,
                stroke 0.3s ease;
  }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    width: 100%;
    position: relative;
  }

  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  .topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
    transition: box-shadow 0.3s ease, background 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .topbar.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: var(--card);
  }
  
  .brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
  }
  
  .logo-square {
    width: 32px;
    height: 32px;
    background: #fbbf24;
    border-radius: 0.75rem;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #000;
    font-size: 0.9rem;
  }
  
  .search-wrap {
    flex: 1;
    max-width: 540px;
  }
  
  .search-wrap input {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--input-border);
    border-radius: 0.75rem;
    background: var(--input-bg);
    color: var(--ink);
    outline: none;
    transition: 0.15s ease-out;
  }

  .search-wrap input:focus {
    background: var(--card);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  .cart-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    color: var(--ink);
    transition: all 0.2s;
  }

  .cart-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  
  .cart-count {
    background: var(--accent);
    color: #fff;
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 9999px;
    font-size: 0.7rem;
  }
  
  .hero {
    display: grid;
    grid-template-columns: 1.13fr 0.87fr;
    gap: 2rem;
    padding: 2.5rem 1.5rem 1.5rem;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  
  .hero-text h1 {
    font-size: clamp(2.5rem, 4vw, 3.2rem);
    margin-bottom: 0.6rem;
  }
  
  .hero-text p {
    max-width: 520px;
    color: var(--muted);
  }
  
  .hero-actions {
    margin-top: 1.3rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
  }
  
  .btn-primary {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 0.65rem 1.1rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    transition: all 0.2s;
  }

  .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-soft);
  }

  .btn-secondary {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.55rem 1rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--ink);
    transition: all 0.2s;
  }

  .btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  
  .small {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }
  
  .shipping-note {
    margin-top: 1.1rem;
    font-size: 0.85rem;
    color: var(--muted);
  }
  
  .hero-img {
    display: grid;
    place-items: center;
  }
  
  .lego-stack {
    display: grid;
    gap: 0.7rem;
    transform: rotate(-6deg);
  }
  
  .brick {
    width: 180px;
    height: 58px;
    border-radius: 14px;
    border: 6px solid rgba(0,0,0,0.08);
    box-shadow:
      0 10px 30px rgba(0,0,0,0.15),
      0 0 0 1px rgba(220, 38, 38, 0.2),
      0 0 25px rgba(220, 38, 38, 0.3),
      0 0 50px rgba(220, 38, 38, 0.15);
  }

  .brick-red {
    background: #dc2626;
  }

  .brick-yellow {
    background: #991b1b;
    margin-left: 30px;
  }

  .brick-blue {
    background: #7f1d1d;
    margin-left: 60px;
  }

  [data-theme="dark"] .brick {
    box-shadow:
      0 10px 30px rgba(0,0,0,0.3),
      0 0 0 1px rgba(239, 68, 68, 0.3),
      0 0 30px rgba(239, 68, 68, 0.4),
      0 0 60px rgba(239, 68, 68, 0.2);
  }
  
  .filters {
    position: fixed;
    top: 64px;
    right: -280px;
    width: 240px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--shadow-card);
    max-height: 75vh;
    overflow-y: auto;
    z-index: 25;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .filters.open {
    right: 1.5rem;
  }

  .filters h2 {
    margin-top: 0;
    font-size: 1.05rem;
    color: var(--ink);
  }

  .filter-label {
    display: block;
    margin-top: 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink);
  }

  .filters select,
  .filters input[type="number"] {
    width: 100%;
    padding: 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--ink);
    margin-top: 0.35rem;
    font-size: 0.95rem;
    transition: all 0.2s;
  }

  .filters select:focus,
  .filters input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--card);
  }

  /* Custom Dropdown Styles */
  .custom-dropdown-wrapper {
    position: relative;
    margin-top: 0.35rem;
  }

  .custom-dropdown-trigger {
    width: 100%;
    padding: 0.6rem 2rem 0.6rem 0.6rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--ink);
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
  }

  .custom-dropdown-trigger:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .custom-dropdown-trigger::after {
    content: '▼';
    position: absolute;
    right: 0.75rem;
    font-size: 0.7rem;
    color: var(--muted);
    transition: transform 0.2s ease;
  }

  .custom-dropdown-trigger.open::after {
    transform: rotate(180deg);
  }

  .dropdown-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--card);
    border: 2px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    animation: dropdownSlide 0.2s ease-out;
  }

  .custom-dropdown-menu.show {
    display: block;
    opacity: 1;
  }

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

  .custom-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
    transition: all 0.15s ease;
    font-size: 0.95rem;
  }

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

  .custom-dropdown-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
    padding-left: 1.25rem;
  }

  .custom-dropdown-item.selected {
    background: var(--accent);
    color: white;
    font-weight: 500;
  }

  .custom-dropdown-item.selected::before {
    content: '✓ ';
    margin-right: 0.25rem;
  }

  .custom-dropdown-menu::-webkit-scrollbar {
    width: 8px;
  }

  .custom-dropdown-menu::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
  }

  .custom-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
  }

  .custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
  }

  .filter-check {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.82rem;
    color: var(--ink);
  }

  /* Filter Section Collapse */
  .filter-section {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .filter-section:last-of-type {
    border-bottom: none;
  }

  .filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0;
    user-select: none;
  }

  .filter-section-header:hover {
    color: var(--accent);
  }

  .filter-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    transition: color 0.2s;
  }

  .filter-section-toggle {
    font-size: 0.7rem;
    color: var(--muted);
    transition: transform 0.3s ease, color 0.2s;
  }

  .filter-section.collapsed .filter-section-toggle {
    transform: rotate(-90deg);
  }

  .filter-section-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
  }

  .filter-section.collapsed .filter-section-content {
    max-height: 0;
    opacity: 0;
  }

  .content-wrapper {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    margin: 1rem auto 4rem auto;
    padding: 0 1.5rem;
    max-width: 1400px;
    width: 100%;
    box-sizing: border-box;
  }

  .products {
    min-width: 0;
  }

  .products h2 {
    margin-bottom: 0.4rem;
  }

  .side-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-sm);
  }

  .side-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--ink);
  }

  .side-panel p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
  }

  .side-panel .highlight {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
  }

  .side-panel .highlight strong {
    color: var(--accent);
    display: block;
    margin-bottom: 0.25rem;
  }

  @media (max-width: 968px) {
    .content-wrapper {
      grid-template-columns: 1fr;
    }

    .side-panel {
      display: none;
    }
  }
  
  .muted {
    color: var(--muted);
  }
  
  .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.1rem;
    margin-top: 1.1rem;
    width: 100%;
    max-width: 100%;
  }
  
  .product-card {
    background: var(--card);
    border-radius: 1.1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.3s;
    width: 100%;
    max-width: 100%;
  }

  .product-card:hover {
    transform: translateY(-6px);
    box-shadow:
      0 20px 60px rgba(0,0,0,0.1),
      0 0 0 2px rgba(225, 29, 72, 0.4),
      0 0 30px rgba(225, 29, 72, 0.5),
      0 0 60px rgba(225, 29, 72, 0.3),
      0 0 100px rgba(225, 29, 72, 0.2);
  }

  [data-theme="dark"] .product-card {
    box-shadow:
      0 10px 30px rgba(0,0,0,0.3),
      0 0 0 1px rgba(244, 63, 94, 0.2),
      0 0 25px rgba(244, 63, 94, 0.25),
      0 0 50px rgba(244, 63, 94, 0.15);
  }

  [data-theme="dark"] .product-card:hover {
    box-shadow:
      0 20px 60px rgba(0,0,0,0.4),
      0 0 0 2px rgba(244, 63, 94, 0.6),
      0 0 40px rgba(244, 63, 94, 0.6),
      0 0 80px rgba(244, 63, 94, 0.4),
      0 0 120px rgba(244, 63, 94, 0.3);
  }

  .product-img-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .product-img {
    background: #fafafa;
    height: 180px;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: rgba(0,0,0,0.3);
    font-size: 0.8rem;
    overflow: hidden;
    position: relative;
    padding: 1rem;
    border: 1px solid rgba(0,0,0,0.06);
  }

  [data-theme="dark"] .product-img {
    background: #ffffff;
    color: rgba(0,0,0,0.3);
    border: 1px solid rgba(0,0,0,0.1);
  }

  .favorite-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    color: #e11d48;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  .favorite-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  .favorite-btn.favorited {
    background: #e11d48;
    color: #ffffff;
  }

  .favorite-btn.favorited:hover {
    background: #be123c;
  }

  [data-theme="dark"] .favorite-btn {
    background: rgba(30, 30, 30, 0.95);
    color: #f43f5e;
  }

  [data-theme="dark"] .favorite-btn:hover {
    background: rgba(30, 30, 30, 1);
  }

  [data-theme="dark"] .favorite-btn.favorited {
    background: #f43f5e;
    color: #ffffff;
  }

  [data-theme="dark"] .favorite-btn.favorited:hover {
    background: #e11d48;
  }

  .product-img img {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    object-position: center;
    filter:
      drop-shadow(0 4px 12px rgba(0,0,0,0.1))
      drop-shadow(0 0 20px rgba(0,0,0,0.05));
    transition: filter 0.3s;
  }

  .product-card:hover .product-img img {
    filter:
      drop-shadow(0 6px 16px rgba(0,0,0,0.15))
      drop-shadow(0 0 30px rgba(0,0,0,0.08));
  }

  .product-body {
    padding: 0.6rem 0.7rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    background: #f8f9fa;
    border-top: 1px solid rgba(0,0,0,0.06);
  }

  [data-theme="dark"] .product-card {
    background: var(--card);
  }

  [data-theme="dark"] .product-body {
    background: #1f1f1f;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  
  .product-title {
    font-weight: 600;
  }
  
  .badge {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 9999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.65rem;
    width: fit-content;
  }

  .badge-new {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    font-weight: 600;
  }

  [data-theme="dark"] .badge-new {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
  }
  
  .price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .price {
    font-weight: 700;
  }
  
  .stock-tag {
    font-size: 0.7rem;
    color: var(--muted);
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
  }

  .stock-tag.in-stock {
    background: #d1fae5;
    color: #065f46;
  }

  .stock-tag.out-of-stock {
    background: #fee2e2;
    color: #991b1b;
  }

  .stock-tag.low-stock {
    background: #fef3c7;
    color: #92400e;
  }
  
  .add-btn {
    margin-top: auto;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 0.85rem;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
  }

  .add-btn:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
  }

  .add-btn:disabled {
    background: var(--muted);
    cursor: not-allowed;
    opacity: 0.5;
  }
  
  .cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: var(--card);
    box-shadow: -8px 0 40px rgba(0,0,0,0.15),
                0 0 30px rgba(220, 38, 38, 0.15),
                0 0 60px rgba(220, 38, 38, 0.08);
    border-left: 2px solid rgba(220, 38, 38, 0.3);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
  }

  .cart-drawer.open {
    right: 0;
  }

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

  .cart-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
  }

  .cart-header button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.25rem;
    color: var(--muted);
  }

  .cart-header button:hover {
    background: var(--bg);
    border-color: var(--muted);
    color: var(--ink);
  }
  
  .cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: grid;
    gap: 1rem;
    background: var(--bg);
  }

  .cart-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
  }

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

  .cart-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.25rem;
  }

  .cart-item small {
    color: var(--muted);
    font-size: 0.85rem;
  }

  .cart-item button {
    background: var(--accent-soft);
    color: var(--accent);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
  }

  .cart-item button:hover {
    background: var(--accent);
    color: white;
  }
  
  .cart-footer {
    border-top: 2px solid var(--border);
    padding: 1.5rem;
    background: var(--card);
  }

  .cart-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ink);
  }

  .cart-footer .btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
  }

  .cart-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-soft);
  }

  .cart-footer .muted {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.8rem;
  }
  
  .backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 35;
  }

  .backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
  
  .footer {
    text-align: center;
    padding: 1.4rem 1rem 2rem;
    font-size: 0.75rem;
    color: var(--muted);
  }

  .theme-toggle {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.2rem;
    transition: all 0.2s;
  }

  .theme-toggle:hover {
    background: var(--bg);
    transform: scale(1.05);
  }

  /* Custom modal styles */
  .custom-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
  }

  .custom-modal.show {
    display: flex;
  }

  .modal-content {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    max-width: 450px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
    border: 1px solid var(--border);
  }

  .modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .modal-message {
    color: var(--muted);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1rem;
  }

  .modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
  }

  .modal-btn {
    padding: 0.875rem 1.75rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    min-width: 100px;
  }

  .modal-btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
  }

  .modal-btn-primary:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  }

  .modal-btn-secondary {
    background: var(--bg);
    color: var(--ink);
    border: 2px solid var(--border);
  }

  .modal-btn-secondary:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

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

  @media (max-width: 960px) {
    .hero {
      grid-template-columns: 1fr;
    }
    .filters {
      right: -300px;
      top: 78px;
      max-width: 90vw;
    }

    .filters.open {
      right: 1rem;
    }
    .search-wrap {
      display: none;
    }

    /* Mobile topbar adjustments */
    .topbar {
      padding: 0.6rem 0.75rem;
      gap: 0.4rem;
      flex-wrap: nowrap;
      overflow: visible;
    }

    .topbar > div {
      flex-shrink: 0;
    }

    .brand {
      flex-shrink: 0;
      min-width: 0;
    }

    .brand-text {
      font-size: 0.85rem;
      white-space: nowrap;
    }

    /* Mobile hero adjustments */
    .hero-text h1 {
      font-size: 2rem;
    }

    .hero-text p {
      font-size: 0.95rem;
    }

    .hero-actions {
      flex-direction: column;
      width: 100%;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
      width: 100%;
    }

    /* Mobile product grid */
    .product-grid {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 0.8rem;
    }

    .content-wrapper {
      padding: 0 1rem;
      gap: 1.5rem;
    }

    /* Smaller product cards on mobile */
    .product-card {
      border-radius: 0.85rem;
    }

    .product-img {
      height: 140px;
      padding: 0.75rem;
    }

    .product-body {
      padding: 0.5rem 0.6rem 0.75rem;
    }

    .product-title {
      font-size: 0.85rem;
    }

    .price {
      font-size: 1.1rem;
    }

    /* Mobile cart drawer - full width */
    .cart-drawer {
      width: 100%;
      right: -100%;
    }

    .cart-drawer.open {
      right: 0;
    }
  }

  @media (max-width: 640px) {
    .filters {
      width: min(280px, 90vw);
      right: -100%;
    }

    .filters.open {
      right: 0;
    }

    .content-wrapper {
      padding: 0 0.75rem;
    }

    .hero {
      padding: 2rem 0.75rem 1.5rem;
    }

    /* Even smaller on very small screens */
    .topbar {
      padding: 0.5rem 0.5rem;
      gap: 0.3rem;
    }

    .brand img {
      height: 32px;
    }

    .brand-text {
      font-size: 0.85rem;
    }

    /* Compact buttons */
    .cart-btn {
      padding: 0.35rem 0.5rem;
      font-size: 0.85rem;
      min-width: auto;
    }

    .theme-toggle {
      padding: 0.35rem 0.5rem;
      font-size: 0.85rem;
    }

    /* Hero text smaller */
    .hero-text h1 {
      font-size: 1.75rem;
    }

    .hero-text p {
      font-size: 0.9rem;
    }

    .shipping-note {
      font-size: 0.75rem;
    }

    /* Product grid tighter */
    .product-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 0.6rem;
    }

    .product-card {
      border-radius: 0.75rem;
    }

    .product-img {
      height: 120px;
      padding: 0.5rem;
    }

    .product-body {
      padding: 0.45rem 0.5rem 0.65rem;
    }

    .product-title {
      font-size: 0.8rem;
      line-height: 1.3;
    }

    .price {
      font-size: 1rem;
    }

    .add-btn {
      padding: 0.5rem 0.75rem;
      font-size: 0.85rem;
    }

    /* Modal adjustments */
    .product-modal {
      padding: 1rem;
    }

    .product-modal-content {
      max-height: 95vh;
    }

    .product-modal-body {
      padding: 1.5rem 1rem;
    }

    .product-modal-info h2 {
      font-size: 1.4rem;
    }

    .product-modal-price .price {
      font-size: 1.5rem;
    }

    /* Cart drawer adjustments */
    .cart-header h2 {
      font-size: 1.25rem;
    }

    .cart-item {
      padding: 0.75rem;
    }

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

    .cart-item-name {
      font-size: 0.85rem;
    }

    .cart-item-price {
      font-size: 0.8rem;
    }
  }

  /* Extra small devices */
  @media (max-width: 380px) {
    .topbar {
      padding: 0.4rem 0.4rem;
      gap: 0.25rem;
    }

    .brand img {
      height: 26px;
    }

    .brand-text {
      display: none;
    }

    .content-wrapper {
      padding: 0 0.5rem;
    }

    .hero {
      padding: 1.5rem 0.5rem 1rem;
    }

    .hero-text h1 {
      font-size: 1.5rem;
    }

    .product-grid {
      grid-template-columns: 1fr;
      gap: 0.75rem;
    }

    .cart-btn {
      padding: 0.35rem 0.5rem;
      font-size: 0.85rem;
    }

    .theme-toggle {
      padding: 0.35rem 0.5rem;
      font-size: 0.85rem;
    }
  }

  /* ========== PRODUCT DETAIL MODAL ========== */
  .product-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 2rem;
  }

  .product-modal.show {
    display: flex;
  }

  .product-modal-content {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
  }

  .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--ink);
    transition: background 0.2s;
    z-index: 10;
  }

  .modal-close:hover {
    background: rgba(0,0,0,0.2);
  }

  [data-theme="dark"] .modal-close {
    background: rgba(255,255,255,0.1);
  }

  [data-theme="dark"] .modal-close:hover {
    background: rgba(255,255,255,0.2);
  }

  .product-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
  }

  .product-modal-image {
    background: #fafafa;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
  }

  [data-theme="dark"] .product-modal-image {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
  }

  .product-modal-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
  }

  .product-modal-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .product-modal-info h2 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--ink);
  }

  .product-modal-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .product-modal-price {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

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

  .product-modal-details {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
  }

  .detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .detail-label {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.9rem;
  }

  .detail-value {
    font-weight: 400;
    color: var(--ink);
    font-size: 0.875rem;
  }

  .btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  @media (max-width: 768px) {
    .product-modal-body {
      grid-template-columns: 1fr;
      gap: 1.5rem;
    }

    .product-modal-image {
      min-height: 250px;
    }
  }

  /* ==================== LOADING SKELETONS ==================== */

  .skeleton {
    background: linear-gradient(
      90deg,
      var(--card) 0%,
      var(--input-bg) 50%,
      var(--card) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
  }

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

  /* Product card skeleton */
  .skeleton-product-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-card);
  }

  .skeleton-product-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 1rem;
  }

  .skeleton-product-title {
    height: 20px;
    width: 80%;
    margin-bottom: 0.5rem;
  }

  .skeleton-product-subtitle {
    height: 16px;
    width: 60%;
    margin-bottom: 0.75rem;
  }

  .skeleton-product-price {
    height: 24px;
    width: 40%;
    margin-bottom: 0.75rem;
  }

  .skeleton-product-button {
    height: 40px;
    width: 100%;
    border-radius: 8px;
  }

  /* Order card skeleton */
  .skeleton-order-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1rem;
  }

  .skeleton-order-header {
    height: 20px;
    width: 50%;
    margin-bottom: 1rem;
  }

  .skeleton-order-line {
    height: 16px;
    width: 70%;
    margin-bottom: 0.5rem;
  }

  .skeleton-order-line.short {
    width: 40%;
  }

  .skeleton-order-line.long {
    width: 90%;
  }

  /* Table skeleton */
  .skeleton-table-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .skeleton-table-cell {
    height: 20px;
  }

  /* Text skeletons */
  .skeleton-text {
    height: 16px;
    border-radius: 4px;
  }

  .skeleton-text.h1 {
    height: 32px;
    width: 60%;
    margin-bottom: 1rem;
  }

  .skeleton-text.h2 {
    height: 24px;
    width: 50%;
    margin-bottom: 0.75rem;
  }

  .skeleton-text.h3 {
    height: 20px;
    width: 40%;
    margin-bottom: 0.5rem;
  }

  .skeleton-text.p {
    height: 16px;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .skeleton-text.short {
    width: 30%;
  }

  .skeleton-text.medium {
    width: 60%;
  }

  .skeleton-text.long {
    width: 90%;
  }

  /* ==================== EMPTY STATES ==================== */

  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    min-height: 400px;
  }

  .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
  }

  @keyframes float {
    0%, 100% {
      transform: translateY(0px);
    }
    50% {
      transform: translateY(-10px);
    }
  }

  .empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 auto 0.5rem auto;
    width: 100%;
  }

  .empty-state-message {
    font-size: 1rem;
    color: var(--muted);
    margin: 0 auto 2rem auto;
    max-width: 400px;
    line-height: 1.6;
  }

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

  .empty-state-card {
    background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
    border: 2px dashed rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 3rem 2rem;
  }

  [data-theme="dark"] .empty-state-card {
    border-color: rgba(239, 68, 68, 0.3);
  }

  /* Custom Checkbox Styles */
  input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background-color: var(--card);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
  }

  input[type="checkbox"]:hover {
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }

  input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
  }

  input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -65%) rotate(45deg);
  }

  input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
  }

  [data-theme="dark"] input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25);
  }

  input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  /* Checkbox label spacing */
  label input[type="checkbox"] {
    margin-right: 0.5rem;
  }