/* Shop specific styles — extends base.css variables and components
   Focus: product grid, filters, product cards, modal, cart preview, accessibility
*/

:root {
  /* small shop-specific tuning */
  --shop-aspect-ratio: 4 / 3;
  --shop-card-padding: var(--space-4);
  --shop-sidebar-width: 320px;
  --shop-gap: var(--space-6);
}

/* Layout: main shop area */
#shop-main {
  padding-top: var(--space-12);
  padding-bottom: var(--space-16);
}

/* Header row inside shop */
#shop-main .flex.items-center {
  gap: var(--space-6);
  align-items: center;
}

/* Search form sizing */
#search-form {
  display: inline-block;
  min-width: 220px;
}

#search-form .form-input {
  width: 320px;
  max-width: 40vw;
  padding-right: var(--space-8);
  background-image: url('/assets/images/icon-search.svg');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

/* Cart mini */
.cart-mini .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

#cart-count {
  background: var(--color-neutral-900);
  color: var(--color-primary-light);
  border-radius: var(--radius-full);
  padding: 0 var(--space-2);
  font-size: var(--font-size-sm);
  margin-left: var(--space-2);
}

/* Grid layout: sidebar + products */
.grid.grid-cols-4 {
  grid-template-columns: minmax(0, var(--shop-sidebar-width)) 1fr;
  gap: var(--shop-gap);
}

/* Sidebar filters */
.filters .card {
  position: sticky;
  top: var(--space-8);
  align-self: start;
  padding: var(--shop-card-padding);
}

.filters .filter-item {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
  color: var(--color-text-secondary);
}

.filters input[type="checkbox"],
.filters input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
}

/* Products column */
.products {
  width: 100%;
}

#products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--shop-gap);
}

/* Product card adjustments */
.product-card {
  padding: var(--shop-card-padding);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.product-media {
  width: 100%;
  aspect-ratio: var(--shop-aspect-ratio);
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  background: linear-gradient(180deg, rgba(0,0,0,0.15), transparent);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-media img {
  transform: scale(1.03);
}

/* Title, meta and description */
.product-card .card-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
  color: var(--color-primary);
}

.product-card .text-muted {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* Price styling */
.price {
  font-family: var(--font-primary);
  color: var(--color-primary-light);
  font-size: var(--font-size-md);
}

.price .old {
  text-decoration: line-through;
  color: var(--color-text-muted);
  margin-right: var(--space-2);
  font-size: var(--font-size-sm);
}

/* Card footer actions */
.product-card .card-footer {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
  border-top: none;
  padding-top: 0;
}

.add-to-cart {
  white-space: nowrap;
}

/* Make add-to-cart prominent */
.add-to-cart {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* Badge position for featured items */
.product-card .badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-popover);
}

/* Sale / New ribbons */
.product-card .ribbon {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-12%, -12%) rotate(-12deg);
  background: var(--color-accent);
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Pagination */
.pagination {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: center;
}

.pagination .btn {
  min-width: 44px;
}

/* Product modal (quick view) */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal);
  padding: var(--space-6);
  transition: opacity var(--transition-base);
}

.modal[hidden] {
  pointer-events: none;
  opacity: 0;
}

.modal-panel {
  width: min(980px, 96%);
  background: linear-gradient(180deg, var(--color-background-elevated), var(--color-surface));
  border: 1px solid var(--color-neutral-700);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-6);
  max-height: calc(100vh - var(--space-12));
  overflow: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  right: var(--space-4);
  top: var(--space-4);
  background: transparent;
  color: var(--color-text);
  font-size: var(--font-size-2xl);
  border: none;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-6);
  align-items: start;
}

#product-modal-media img {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  .grid.grid-cols-4 {
    grid-template-columns: 1fr;
  }

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

  .modal-body {
    grid-template-columns: 1fr;
  }

  #search-form .form-input {
    width: 220px;
  }
}

@media (max-width: 768px) {
  #products-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .product-card {
    padding: var(--space-4);
  }

  #search-form .form-input {
    width: 100%;
    max-width: 100%;
  }

  .product-card .card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .add-to-cart,
  .btn-ghost {
    width: 100%;
  }
}

/* Accessibility: focus styles for product cards */
.product-card:focus-within,
.product-card:focus {
  outline: 3px solid rgba(201,169,97,0.12);
  box-shadow: 0 0 0 4px var(--color-primary-glow);
  transform: translateY(-6px);
}

/* Tiny helpers */
.product-meta {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

/* Empty state */
.products-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-secondary);
}



:root {
  /* small shop-specific tuning */
  --shop-aspect-ratio: 4 / 3;
  --shop-card-padding: var(--space-4);
  --shop-sidebar-width: 320px;
  --shop-gap: var(--space-6);
}

/* Layout: main shop area */
#shop-main {
  padding-top: var(--space-12);
  padding-bottom: var(--space-16);
}

/* Header row inside shop */
#shop-main .flex.items-center {
  gap: var(--space-6);
  align-items: center;
}

/* Search form sizing */
#search-form {
  display: inline-block;
  min-width: 220px;
}

#search-form .form-input {
  width: 320px;
  max-width: 40vw;
  padding-right: var(--space-8);
  background-image: url('/assets/images/icon-search.svg');
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

/* Cart mini */
.cart-mini .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

#cart-count {
  background: var(--color-neutral-900);
  color: var(--color-primary-light);
  border-radius: var(--radius-full);
  padding: 0 var(--space-2);
  font-size: var(--font-size-sm);
  margin-left: var(--space-2);
}

/* Grid layout: sidebar + products */
.grid.grid-cols-4 {
  grid-template-columns: minmax(0, var(--shop-sidebar-width)) 1fr;
  gap: var(--shop-gap);
}

/* Sidebar filters */
.filters .card {
  position: sticky;
  top: var(--space-8);
  align-self: start;
  padding: var(--shop-card-padding);
}

.filters .filter-item {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
  color: var(--color-text-secondary);
}

.filters input[type="checkbox"],
.filters input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
}

/* Products column */
.products {
  width: 100%;
}

#products-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--shop-gap);
}

/* Product card adjustments */
.product-card {
  padding: var(--shop-card-padding);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.product-media {
  width: 100%;
  aspect-ratio: var(--shop-aspect-ratio);
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  background: linear-gradient(180deg, rgba(0,0,0,0.15), transparent);
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-media img {
  transform: scale(1.03);
}

/* Title, meta and description */
.product-card .card-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
  color: var(--color-primary);
}

.product-card .text-muted {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

/* Price styling */
.price {
  font-family: var(--font-primary);
  color: var(--color-primary-light);
  font-size: var(--font-size-md);
}

.price .old {
  text-decoration: line-through;
  color: var(--color-text-muted);
  margin-right: var(--space-2);
  font-size: var(--font-size-sm);
}

/* Card footer actions */
.product-card .card-footer {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
  border-top: none;
  padding-top: 0;
}

.add-to-cart {
  white-space: nowrap;
}

/* Make add-to-cart prominent */
.add-to-cart {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* Badge position for featured items */
.product-card .badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-popover);
}

/* Sale / New ribbons */
.product-card .ribbon {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-12%, -12%) rotate(-12deg);
  background: var(--color-accent);
  color: var(--color-text);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Pagination */
.pagination {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: center;
}

.pagination .btn {
  min-width: 44px;
}

/* Product modal (quick view) */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-modal);
  padding: var(--space-6);
  transition: opacity var(--transition-base);
}

.modal[hidden] {
  pointer-events: none;
  opacity: 0;
}

.modal-panel {
  width: min(980px, 96%);
  background: linear-gradient(180deg, var(--color-background-elevated), var(--color-surface));
  border: 1px solid var(--color-neutral-700);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-6);
  max-height: calc(100vh - var(--space-12));
  overflow: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  right: var(--space-4);
  top: var(--space-4);
  background: transparent;
  color: var(--color-text);
  font-size: var(--font-size-2xl);
  border: none;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-6);
  align-items: start;
}

#product-modal-media img {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}

/* Mobile adjustments */
@media (max-width: 1024px) {
  .grid.grid-cols-4 {
    grid-template-columns: 1fr;
  }

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

  .modal-body {
    grid-template-columns: 1fr;
  }

  #search-form .form-input {
    width: 220px;
  }
}

@media (max-width: 768px) {
  #products-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .product-card {
    padding: var(--space-4);
  }

  #search-form .form-input {
    width: 100%;
    max-width: 100%;
  }

  .product-card .card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .add-to-cart,
  .btn-ghost {
    width: 100%;
  }
  #shop-main .flex{
    flex-direction: column;
  }
}

/* Accessibility: focus styles for product cards */
.product-card:focus-within,
.product-card:focus {
  outline: 3px solid rgba(201,169,97,0.12);
  box-shadow: 0 0 0 4px var(--color-primary-glow);
  transform: translateY(-6px);
}

/* Tiny helpers */
.product-meta {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

/* Empty state */
.products-empty {
  padding: var(--space-8);
  text-align: center;
  color: var(--color-text-secondary);
}

/* End of shop.css */