/* Storefront CSS - Exact Match to Reference Image */

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #0a0a0a;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}

/* Navigation Bar */
.navbar {
  background-color: #000000;
  border-bottom: 1px solid #333;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
}

.logo-icon {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* Navigation Categories */
.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-categories {
  display: flex;
  list-style: none;
  gap: 40px;
  margin: 0;
  padding: 0;
}

/* Dropdown styles */
.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 8px 0;
  min-width: 150px;
  list-style: none;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  padding: 0;
}

.dropdown-menu .nav-category {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
}

.dropdown-menu .nav-category:hover {
  background-color: #333;
}

.nav-category {
  color: #cccccc;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 18px 0;
  transition: color 0.2s;
}

.nav-category:hover {
  color: #ffffff;
}

.nav-category.deals-highlight {
  background-color: #dc2626;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  margin-top: 10px;
  height: fit-content;
}

.nav-category.deals-highlight:hover {
  background-color: #b91c1c;
}

/* Navigation Actions */
.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Navigation Search Form */
.nav-search-form {
  display: flex;
  align-items: center;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.nav-search-form:focus-within {
  border-color: #dc2626;
}

.nav-search-input {
  background: transparent;
  border: none;
  color: #fff;
  padding: 8px 12px;
  font-size: 14px;
  width: 200px;
  outline: none;
}

.nav-search-input::placeholder {
  color: #666;
}

@media (max-width: 900px) {
  .nav-search-input {
    width: 140px;
  }
}

@media (max-width: 600px) {
  .nav-search-form {
    display: none;
  }
}

/* Search Autocomplete Dropdown */
.nav-search-form {
  position: relative;
}

.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  max-height: 480px;
  overflow-y: auto;
  min-width: 350px;
}

.search-autocomplete[hidden] {
  display: none;
}

/* Category Chips */
.autocomplete-categories {
  padding: 12px 16px;
  border-bottom: 1px solid #333;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.autocomplete-categories:empty {
  display: none;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #2a2a2a;
  color: #ccc;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.category-chip:hover,
.category-chip.selected {
  background-color: #dc2626;
  color: #fff;
}

.category-chip-icon {
  font-size: 14px;
}

/* Product Results */
.autocomplete-products {
  padding: 8px 0;
}

.autocomplete-products:empty {
  display: none;
}

.autocomplete-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
  color: inherit;
}

.autocomplete-product:hover,
.autocomplete-product.selected {
  background-color: #252525;
}

.autocomplete-product-image {
  width: 50px;
  height: 50px;
  background-color: #111;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.autocomplete-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.autocomplete-product-info {
  flex: 1;
  min-width: 0;
}

.autocomplete-product-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-product-meta {
  font-size: 12px;
  color: #888;
}

.autocomplete-product-price {
  font-size: 15px;
  font-weight: 600;
  color: #22c55e;
  white-space: nowrap;
}

/* Footer */
.autocomplete-footer {
  padding: 10px 16px;
  border-top: 1px solid #333;
  font-size: 12px;
  color: #666;
  text-align: center;
}

/* No Results */
.autocomplete-no-results {
  padding: 24px 16px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 900px) {
  .search-autocomplete {
    min-width: 280px;
  }
}


.search-btn,
.account-btn,
.cart-btn {
  background: none;
  border: none;
  color: #cccccc;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: color 0.2s;
}

.search-btn:hover,
.account-btn:hover,
.cart-btn:hover {
  color: #ffffff;
}

.cart-btn {
  position: relative;
}

.cart-count {
  background-color: #dc2626;
  color: #ffffff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  margin-left: 4px;
}

/* Main Content */
.storefront-main {
  padding: 40px 0;
  min-height: calc(100vh - 60px);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Product Cards */
.product-card {
  background-color: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Product Badge */
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
}

.product-badge.best-seller {
  background-color: #dc2626;
  color: #ffffff;
}

.product-badge.new {
  background-color: #22c55e;
  color: #ffffff;
}

.product-badge.sale {
  background-color: #dc2626;
  color: #ffffff;
}

/* Product Image */
.product-image {
  width: 100%;
  height: 240px;
  background-color: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.placeholder-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.placeholder-icon {
  font-size: 48px;
  opacity: 0.3;
}

.cdn-notice {
  font-size: 10px;
  color: #666;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}

/* Product Info */
.product-info {
  padding: 20px;
}

.product-category {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-manufacturer {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 8px;
}

.product-specs {
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
  line-height: 1.4;
}

.product-features {
  display: none; /* Hide for cleaner look like reference */
}

.stock-status {
  display: none; /* Hide for cleaner look like reference */
}

/* Product Footer */
.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.btn-add-cart {
  background-color: #dc2626;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-add-cart:hover {
  background-color: #b91c1c;
}

.btn-add-cart:disabled {
  background-color: #555;
  color: #999;
  cursor: not-allowed;
}

/* Storefront Layout - Sidebar + Products */
.storefront-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}

/* Category Sidebar */
.category-sidebar {
  background-color: #111;
  border-radius: 12px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #333;
}

.category-tree details {
  margin-bottom: 8px;
}

.category-tree summary {
  cursor: pointer;
  padding: 12px 16px;
  background-color: #1a1a1a;
  border-radius: 8px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s;
  list-style: none;
}

.category-tree summary::-webkit-details-marker {
  display: none;
}

.category-tree summary::after {
  content: '+';
  margin-left: auto;
  font-weight: 400;
  color: #666;
}

.category-tree details[open] summary::after {
  content: '−';
}

.category-tree summary:hover {
  background-color: #252525;
}

.cat-icon {
  font-size: 16px;
}

.subcategory-list {
  list-style: none;
  padding: 8px 0 8px 28px;
  margin: 0;
}

.subcategory-list li {
  margin-bottom: 4px;
}

.subcategory-list a {
  display: block;
  padding: 8px 12px;
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
}

.subcategory-list a:hover {
  background-color: #1a1a1a;
  color: #fff;
}

.subcategory-list a.active {
  background-color: #dc2626;
  color: #fff;
}

/* Products Area */
.products-area {
  min-width: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.breadcrumb a {
  color: #888;
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: #dc2626;
}

.breadcrumb .separator {
  color: #555;
}

.breadcrumb .current {
  color: #fff;
  font-weight: 500;
}

/* Results Header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background-color: #111;
  border-radius: 8px;
}

.results-count {
  color: #888;
  font-size: 14px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-controls label {
  color: #888;
  font-size: 14px;
}

.sort-select {
  background-color: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: #dc2626;
}

/* Responsive - Hide sidebar on mobile */
@media (max-width: 900px) {
  .storefront-layout {
    grid-template-columns: 1fr;
  }
  
  .category-sidebar {
    display: none;
  }
  
  .nav-categories {
    display: none;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .nav-container {
    padding: 0 16px;
  }
  
  .results-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* Hide unused elements */
.no-results {
  display: none;
}

/* ================================================
   CART SLIDE-OUT PANEL
   ================================================ */

.cart-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  pointer-events: none;
}

.cart-panel:not([hidden]) {
  pointer-events: auto;
}

.cart-panel[hidden] {
  display: block;
  visibility: hidden;
}

.cart-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-panel:not([hidden]) .cart-panel-overlay {
  opacity: 1;
}

.cart-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background-color: #111;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.cart-panel:not([hidden]) .cart-panel-content {
  transform: translateX(0);
}

.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #333;
}

.cart-panel-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.cart-panel-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.cart-panel-close:hover {
  color: #fff;
  background-color: #333;
}

.cart-panel-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
  color: #666;
  text-align: center;
}

.cart-panel-empty svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.cart-panel-empty p {
  font-size: 16px;
  margin-bottom: 24px;
}

.btn-continue-shopping {
  padding: 12px 24px;
  background-color: #333;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-continue-shopping:hover {
  background-color: #444;
}

/* Cart Item */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #222;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  background-color: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-item-brand {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 600;
  color: #22c55e;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  background-color: #2a2a2a;
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.cart-qty-btn:hover {
  background-color: #444;
}

.cart-qty-input {
  width: 40px;
  height: 28px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  color: #fff;
  text-align: center;
  font-size: 14px;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  transition: color 0.2s;
}

.cart-item-remove:hover {
  color: #dc2626;
}

/* Cart Footer */
.cart-panel-footer {
  padding: 20px 24px;
  border-top: 1px solid #333;
  background-color: #0a0a0a;
}

.cart-totals {
  margin-bottom: 16px;
}

.cart-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  color: #aaa;
}

.cart-totals-row.cart-total {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid #333;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.btn-checkout {
  display: block;
  width: 100%;
  padding: 16px;
  background-color: #dc2626;
  color: #fff;
  text-decoration: none;
  text-align: center;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn-checkout:hover {
  background-color: #b91c1c;
}

/* ================================================
   CART NOTIFICATION TOAST
   ================================================ */

.cart-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 3000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cart-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.cart-notification-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #22c55e;
  font-weight: 500;
}

.cart-notification-action {
  padding: 8px 16px;
  background-color: #dc2626;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.2s;
}

.cart-notification-action:hover {
  background-color: #b91c1c;
}

@media (max-width: 600px) {
  .cart-panel-content {
    max-width: 100%;
  }
  
  .cart-notification {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}
