/* Reset & base */
    *, *::before, *::after {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      font-family: 'Inter', sans-serif;
      background: #ffffff;
      color: #4b5563; /* slate-600 */
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      line-height: 1.5;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      overflow-x: hidden;
    }
    a {
      text-decoration: none;
      color: inherit;
    }
    button {
      cursor: pointer;
      font-family: inherit;
      border: none;
      background: none;
    }
    /* Scrollbar style */
    ::-webkit-scrollbar {
      width: 10px;
      height: 10px;
    }
    ::-webkit-scrollbar-thumb {
      background-color: #a78bfa; /* purple-400 */
      border-radius: 5px;
    }
    ::-webkit-scrollbar-track {
      background-color: #f9fafb;
    }

    /* Material Icons helper */
    .material-icons {
      font-family: 'Material Icons';
      font-weight: normal;
      font-style: normal;
      font-size: 20px;
      line-height: 1;
      letter-spacing: normal;
      text-transform: none;
      display: inline-block;
      white-space: nowrap;
      direction: ltr;
      -webkit-font-smoothing: antialiased;
      vertical-align: middle;
    }

    /* Container max width */
    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 16px;
      width: 100%;
    }

    /* Header */
    header {
      position: sticky;
      top: 0;
      z-index: 120;
      background: #ffffff;
      border-bottom: 1px solid #e5e7eb; /* gray-200 */
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    .header-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      max-width: 1200px;
      margin: 0 auto;
      padding: 12px 16px;
      gap: 1rem;
    }
    .logo {
      font-weight: 800;
      font-size: 28px;
      color: #7c3aed; /* purple-700 */
      letter-spacing: -0.02em;
    }

    /* Search bar */
    .search-container {
      flex: 1;
      max-width: 600px;
      position: relative;
    }
    .search-input {
      width: 100%;
      padding: 10px 40px 10px 16px;
      border-radius: 12px;
      border: 1px solid #d1d5db; /* gray-300 */
      font-size: 16px;
      color: #374151; /* gray-700 */
      transition: border-color 0.3s ease;
    }
    .search-input:focus {
      outline: none;
      border-color: #8b5cf6; /* purple-500 */
      box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
    }
    .search-icon {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      color: #9ca3af; /* gray-400 */
      pointer-events: none;
      font-size: 24px;
    }

    /* Navigation with categories - simple text nav */
    nav.main-nav {
      display: flex;
      gap: 24px;
      font-weight: 600;
      font-size: 16px;
    }
    nav.main-nav a {
      color: #6b7280;
      padding: 6px 8px;
      border-radius: 8px;
      transition: background-color 0.25s ease, color 0.25s ease;
    }
    nav.main-nav a:hover,
    nav.main-nav a:focus {
      background: #ede9fe; /* purple-100 */
      color: #7c3aed; /* purple-700 */
      outline: none;
    }

    /* Cart icon with count */
    .cart-button {
      position: relative;
      display: flex;
      align-items: center;
      color: #6b7280;
      transition: color 0.25s ease;
      font-size: 28px;
    }
    .cart-button:hover,
    .cart-button:focus {
      color: #7c3aed;
      outline: none;
    }
    .cart-count {
      position: absolute;
      top: -5px;
      right: -5px;
      background: #7c3aed;
      color: white;
      font-size: 12px;
      height: 18px;
      min-width: 18px;
      padding: 0 6px;
      border-radius: 12px;
      font-weight: 700;
      text-align: center;
      line-height: 18px;
      pointer-events: none;
    }

    /* Main app layout */
    #app {
      flex: 1;
      display: grid;
      grid-template-columns: 1fr;
      padding: 16px 16px 40px;
      gap: 16px;
      max-width: 1200px;
      margin: 0 auto;
    }
    @media(min-width: 1025px) {
      #app {
        grid-template-columns: 300px 1fr 350px;
      }
    }
    @media(min-width: 641px) and (max-width: 1024px) {
      #app {
        grid-template-columns: 1fr 350px;
      }
    }

    /* Sidebar - filters */
    aside.filters-sidebar {
      background: #fafafa;
      padding: 24px;
      border-radius: 12px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.05);
      font-size: 14px;
      color: #4b5563;
      overflow-y: auto;
      max-height: calc(100vh - 100px);
      position: sticky;
      top: 80px;
    }
    .filters-sidebar h2 {
      font-weight: 700;
      font-size: 18px;
      margin-bottom: 16px;
      color: #5b21b6; /* purple-700 */
    }
    .filter-section {
      margin-bottom: 32px;
    }
    .filter-item {
      display: flex;
      align-items: center;
      margin-bottom: 12px;
      cursor: pointer;
    }
    .filter-item input[type="checkbox"] {
      margin-right: 10px;
      cursor: pointer;
    }
    .filter-item label {
      cursor: pointer;
      flex: 1;
    }
    /* Price range slider */
    .price-range-inputs {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-top: 8px;
      max-width: 250px;
    }
    .price-range-inputs input {
      width: 100%;
      padding: 6px 8px;
      border-radius: 8px;
      border: 1px solid #d1d5db;
      font-size: 14px;
      color: #374151;
    }

    /* Middle content - products and controls */
    section.products-section {
      display: flex;
      flex-direction: column;
      gap: 16px;
      overflow: visible;
    }

    .products-controls {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
      padding-bottom: 8px;
      border-bottom: 1px solid #e5e7eb;
    }
    .products-count {
      font-weight: 600;
      color: #6b7280;
      font-size: 14px;
    }
    select.sort-select {
      padding: 8px 12px;
      border-radius: 12px;
      border: 1px solid #d1d5db;
      font-size: 14px;
      color: #374151;
      min-width: 160px;
    }

    /* Product Grid */
    .product-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 24px;
    }

    /* Product Card */
    article.product-card {
      background: white;
      border-radius: 12px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.05);
      display: flex;
      flex-direction: column;
      transition: transform 0.3s ease, box-shadow 0.3s ease;
      position: relative;
      overflow: hidden;
    }
    article.product-card:hover,
    article.product-card:focus-within {
      transform: translateY(-6px);
      box-shadow: 0 10px 20px rgba(124,58,237,0.2);
      outline: none;
    }
    .product-image-wrapper {
      position: relative;
      padding-top: 75%; /* 4:3 aspect ratio */
      overflow: hidden;
      border-top-left-radius: 12px;
      border-top-right-radius: 12px;
      background: #ede9fe;
    }
    .product-image-wrapper img {
      position: absolute;
      top: 0; left: 0; width: 100%; height: 100%;
      object-fit: cover;
      transition: transform 0.4s ease;
      border-radius: 12px 12px 0 0;
    }
    article.product-card:hover .product-image-wrapper img {
      transform: scale(1.07);
    }
    .product-actions {
      position: absolute;
      top: 8px;
      right: 8px;
      display: flex;
      gap: 8px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    article.product-card:hover .product-actions,
    article.product-card:focus-within .product-actions {
      opacity: 1;
    }
    .icon-button {
      background: rgba(255,255,255,0.9);
      border-radius: 50%;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #7c3aed;
      box-shadow: 0 1px 4px rgba(124,58,237,0.3);
      transition: background-color 0.2s ease;
    }
    .icon-button:hover,
    .icon-button:focus {
      background-color: #7c3aed;
      color: white;
      outline: none;
    }
    .product-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      padding: 16px 16px 24px;
      gap: 8px;
    }
    .product-title {
      font-weight: 700;
      font-size: 18px;
      color: #4b5563;
      flex-grow: 1;
      overflow-wrap: break-word;
    }
    .product-category {
      font-size: 12px;
      color: #a78bfa;
      font-weight: 600;
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }
    .product-brand {
      font-size: 14px;
      color: #6b7280;
      font-weight: 500;
    }
    .product-price {
      font-weight: 700;
      font-size: 18px;
      color: #7c3aed;
      margin-top: 4px;
    }
    .product-rating {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 14px;
      color: #fbbf24; /* amber-400 */
    }
    .star-icon {
      font-size: 16px;
    }
    .reviews-count {
      color: #6b7280;
      font-size: 12px;
      margin-left: 4px;
    }

    /* Pagination */
    .pagination {
      display: flex;
      justify-content: center;
      gap: 12px;
      margin-top: 24px;
    }
    .pagination button {
      padding: 6px 12px;
      border-radius: 8px;
      border: 1px solid #d1d5db;
      background: white;
      color: #6b7280;
      font-weight: 600;
      min-width: 40px;
      transition: background-color 0.25s ease, color 0.25s ease;
    }
    .pagination button:hover,
    .pagination button:focus {
      outline: none;
      background-color: #7c3aed;
      color: white;
      border-color: #7c3aed;
    }
    .pagination button[disabled] {
      opacity: 0.5;
      cursor: default;
    }
    .pagination .active-page {
      background-color: #7c3aed;
      color: white;
      border-color: #7c3aed;
      cursor: default;
    }

    /* Cart sidebar */
    aside.cart-sidebar {
      background: #fafafa;
      padding: 24px;
      border-radius: 12px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.05);
      display: flex;
      flex-direction: column;
      height: calc(100vh - 88px);
      position: sticky;
      top: 80px;
      overflow-y: auto;
      color: #4b5563;
      font-size: 14px;
    }
    aside.cart-sidebar h2 {
      font-weight: 700;
      font-size: 20px;
      color: #5b21b6;
      margin-bottom: 12px;
    }
    .cart-items-list {
      flex: 1;
      overflow-y: auto;
      margin-bottom: 16px;
    }
    .cart-item {
      display: flex;
      gap: 12px;
      margin-bottom: 16px;
      border-bottom: 1px solid #e5e7eb;
      padding-bottom: 12px;
    }
    .cart-item:last-child {
      margin-bottom: 0;
      border-bottom: none;
      padding-bottom: 0;
    }
    .cart-item-image {
      width: 64px;
      height: 64px;
      flex-shrink: 0;
      border-radius: 10px;
      background: #ede9fe;
      overflow: hidden;
    }
    .cart-item-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .cart-item-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
    .cart-item-title {
      font-weight: 600;
      font-size: 14px;
      color: #4b5563;
    }
    .cart-item-variant {
      font-size: 12px;
      font-style: italic;
      color: #6b7280;
      margin-top: 2px;
    }
    .cart-item-price {
      font-weight: 700;
      color: #7c3aed;
      font-size: 14px;
      margin-top: 6px;
    }
    .cart-item-qty-controls {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 8px;
    }
    .cart-qty-button {
      background: #ede9fe;
      color: #7c3aed;
      border-radius: 8px;
      width: 28px;
      height: 28px;
      font-weight: 700;
      font-size: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.25s ease;
    }
    .cart-qty-button:hover,
    .cart-qty-button:focus {
      background-color: #7c3aed;
      color: white;
      outline: none;
    }
    .cart-qty-display {
      min-width: 24px;
      text-align: center;
      font-weight: 600;
      font-size: 14px;
    }
    .cart-item-remove {
      background: none;
      color: #ef4444; /* red-500 */
      font-size: 18px;
      align-self: flex-start;
      margin-left: 8px;
      cursor: pointer;
      border-radius: 6px;
      transition: color 0.25s ease;
    }
    .cart-item-remove:hover,
    .cart-item-remove:focus {
      color: #b91c1c;
      outline: none;
    }

    /* Cart summary */
    .cart-summary {
      border-top: 1px solid #e5e7eb;
      padding-top: 12px;
      font-weight: 700;
      font-size: 16px;
      color: #4b5563;
      display: flex;
      justify-content: space-between;
      margin-bottom: 24px;
    }
    .checkout-button {
      background: #7c3aed;
      color: white;
      border-radius: 16px;
      padding: 14px 0;
      font-size: 16px;
      font-weight: 700;
      width: 100%;
      transition: background-color 0.3s ease;
    }
    .checkout-button:hover,
    .checkout-button:focus {
      background-color: #5b21b6;
      outline: none;
    }

    /* Modal backdrop */
    .modal-backdrop {
      position: fixed;
      top: 0; left: 0;
      width: 100vw;
      height: 100vh;
      background-color: rgba(75, 85, 99, 0.5); /* slate-600 transparent */
      z-index: 150;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }
    .modal-backdrop.show {
      opacity: 1;
      pointer-events: auto;
    }

    /* Modal content generic */
    .modal {
      background: white;
      border-radius: 16px;
      max-width: 720px;
      max-height: 90vh;
      overflow-y: auto;
      position: relative;
      box-shadow: 0 12px 24px rgba(124, 58, 237, 0.4);
      padding: 32px;
      width: 100%;
      outline: none;
    }
    .modal-close-button {
      position: absolute;
      top: 16px;
      right: 16px;
      background: none;
      font-size: 28px;
      line-height: 1;
      color: #7c3aed;
      cursor: pointer;
      border-radius: 50%;
      padding: 4px 6px;
      transition: color 0.25s ease;
    }
    .modal-close-button:hover,
    .modal-close-button:focus {
      color: #5b21b6;
      outline: none;
    }

    /* Product Detail modal */
    .modal-product-content {
      display: flex;
      flex-wrap: wrap;
      gap: 24px;
    }
    .modal-product-images {
      flex: 1 1 320px;
      border-radius: 16px;
      overflow: hidden;
      background: #ede9fe;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .modal-main-image {
      width: 100%;
      height: 320px;
      object-fit: cover;
      border-radius: 16px;
      cursor: zoom-in;
    }
    .modal-thumbnails {
      display: flex;
      gap: 12px;
      overflow-x: auto;
      padding-bottom: 8px;
    }
    .modal-thumbnail {
      width: 60px;
      height: 60px;
      border-radius: 12px;
      cursor: pointer;
      border: 2px solid transparent;
      object-fit: cover;
      flex-shrink: 0;
      transition: border-color 0.25s ease;
    }
    .modal-thumbnail.active,
    .modal-thumbnail:hover,
    .modal-thumbnail:focus {
      border-color: #7c3aed;
      outline: none;
    }
    .modal-product-details {
      flex: 1 1 320px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .modal-product-title {
      font-size: 28px;
      font-weight: 800;
      color: #5b21b6;
    }
    .modal-product-price {
      font-size: 24px;
      font-weight: 700;
      color: #7c3aed;
      margin-top: -8px;
    }
    .modal-product-description {
      font-size: 16px;
      color: #374151;
      line-height: 1.5;
    }
    .modal-product-variants {
      font-size: 14px;
      color: #6b7280;
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
    }
    .variant-button {
      padding: 8px 16px;
      font-size: 14px;
      border-radius: 12px;
      background: #ede9fe;
      color: #7c3aed;
      cursor: pointer;
      border: 2px solid transparent;
      font-weight: 600;
      transition: all 0.3s ease;
    }
    .variant-button:hover,
    .variant-button:focus {
      background: #7c3aed;
      color: white;
      outline: none;
    }
    .variant-button.selected {
      background: #7c3aed;
      color: white;
      border-color: #5b21b6;
    }
    .modal-product-actions {
      margin-top: 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .quantity-selector {
      display: flex;
      align-items: center;
      border-radius: 12px;
      border: 1px solid #d1d5db;
      overflow: hidden;
      max-width: 120px;
      background: white;
    }
    .qty-btn {
      border: none;
      background: transparent;
      color: #7c3aed;
      font-weight: 700;
      font-size: 20px;
      width: 36px;
      height: 36px;
      cursor: pointer;
      transition: background-color 0.25s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .qty-btn:hover,
    .qty-btn:focus {
      background-color: #7c3aed;
      color: white;
      outline: none;
    }
    .qty-display {
      width: 48px;
      text-align: center;
      font-weight: 700;
      color: #4b5563;
    }
    .add-to-cart-btn {
      background: #7c3aed;
      color: white;
      border-radius: 20px;
      padding: 12px 20px;
      font-weight: 700;
      transition: background-color 0.3s ease;
      flex-shrink: 0;
      box-shadow: 0 10px 20px rgba(124,58,237,0.3);
    }
    .add-to-cart-btn:hover,
    .add-to-cart-btn:focus {
      background-color: #5b21b6;
      outline: none;
    }

    /* Reviews Section */
    .reviews-section {
      margin-top: 32px;
    }
    .reviews-title {
      font-size: 20px;
      font-weight: 700;
      color: #5b21b6;
      margin-bottom: 16px;
    }
    .review-item {
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid #e5e7eb;
    }
    .review-header {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .reviewer-name {
      font-weight: 700;
      color: #4b5563;
    }
    .review-rating {
      color: #fbbf24;
      font-size: 18px;
      display: flex;
      align-items: center;
    }
    .review-date {
      margin-left: auto;
      font-size: 12px;
      color: #6b7280;
      font-style: italic;
    }
    .review-comment {
      margin-top: 8px;
      font-size: 14px;
      line-height: 1.4;
      color: #374151;
    }

    /* Wishlist */
    .wishlist-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      color: #7c3aed;
      font-weight: 600;
      cursor: pointer;
      transition: color 0.3s ease;
    }
    .wishlist-btn svg {
      font-size: 18px;
    }
    .wishlist-btn:hover,
    .wishlist-btn:focus {
      color: #5b21b6;
      outline: none;
    }
    .wishlist-active {
      color: #dc2626; /* red-600 */
    }

    /* Checkout Overlay */
    .checkout-overlay {
      position: fixed;
      inset: 0;
      background-color: rgba(55, 65, 81, 0.85);
      z-index: 200;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 24px;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }
    .checkout-overlay.show {
      opacity: 1;
      pointer-events: auto;
    }
    .checkout-modal {
      background: white;
      border-radius: 16px;
      max-width: 600px;
      width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 12px 24px rgba(124, 58, 237, 0.5);
      padding: 32px;
      position: relative;
      display: flex;
      flex-direction: column;
      gap: 24px;
    }
    .checkout-stepper {
      display: flex;
      justify-content: space-between;
      margin-bottom: 24px;
    }
    .step {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      font-weight: 700;
      font-size: 14px;
      color: #9ca3af; /* gray-400 */
      position: relative;
    }
    .step.active {
      color: #7c3aed;
    }
    .step.completed {
      color: #6ee7b7; /* emerald-400 */
    }
    .step:not(:last-child)::after {
      content: "";
      position: absolute;
      top: 10px;
      right: 0;
      width: 100%;
      height: 4px;
      background: currentColor;
      opacity: 0.25;
      z-index: -1;
      transform-origin: left center;
    }
    .step.completed:not(:last-child)::after {
      opacity: 1;
    }
    .step-label {
      margin-top: 6px;
      font-size: 12px;
      font-weight: 600;
      color: inherit;
    }
    .checkout-form {
      display: flex;
      flex-direction: column;
      gap: 20px;
    }
    .form-group {
      display: flex;
      flex-direction: column;
    }
    .form-group label {
      font-weight: 600;
      color: #4b5563;
      margin-bottom: 6px;
    }
    .form-group input,
    .form-group select {
      padding: 10px 14px;
      font-size: 16px;
      border-radius: 12px;
      border: 1px solid #d1d5db;
      transition: border-color 0.3s ease;
    }
    .form-group input:focus,
    .form-group select:focus {
      outline: none;
      border-color: #7c3aed;
      box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
    }
    .error-message {
      font-size: 12px;
      color: #dc2626;
      margin-top: 2px;
    }
    .checkout-buttons {
      display: flex;
      justify-content: flex-end;
      gap: 16px;
    }
    .btn-primary {
      background-color: #7c3aed;
      color: white;
      border-radius: 20px;
      padding: 12px 24px;
      font-weight: 700;
      font-size: 16px;
      min-width: 100px;
      transition: background-color 0.3s ease;
    }
    .btn-primary:hover,
    .btn-primary:focus {
      background-color: #5b21b6;
      outline: none;
    }
    .btn-secondary {
      background-color: #e5e7eb;
      color: #374151;
      border-radius: 20px;
      padding: 12px 24px;
      font-weight: 700;
      font-size: 16px;
      min-width: 100px;
      transition: background-color 0.3s ease;
    }
    .btn-secondary:hover,
    .btn-secondary:focus {
      background-color: #d1d5db;
      outline: none;
    }

    /* Star rating input (interactive) */
    .star-rating-input {
      display: flex;
      gap: 4px;
      font-size: 24px;
      cursor: pointer;
    }
    .star-rating-input input[type="radio"] {
      display: none;
    }
    .star-rating-input label {
      color: #d1d5db;
      transition: color 0.25s ease;
    }
    .star-rating-input input[type="radio"]:checked ~ label,
    .star-rating-input label:hover,
    .star-rating-input label:hover ~ label {
      color: #fbbf24;
    }

    /* Loading state */
    .loading-spinner {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 3px solid #d1d5db;
      border-top-color: #7c3aed;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      vertical-align: middle;
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Responsive adjustments */
    @media (max-width: 640px) {
      #app {
        grid-template-columns: 1fr;
        padding: 8px 8px 40px;
      }
      aside.filters-sidebar,
      aside.cart-sidebar {
        display: none;
      }
      .header-inner {
        flex-wrap: wrap;
        gap: 8px;
      }
      .search-container {
        max-width: 100%;
        flex: 1 1 100%;
      }
      nav.main-nav {
        flex: 1 1 100%;
        justify-content: center;
      }
      .cart-button {
        font-size: 24px;
      }
    }