<?php
/**
 * Estilos del rediseño marketplace — complementa main.css
 */
/* Store header */
.store-header {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1040;
}

.store-header-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
}

.store-header .nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  min-width: 0;
  max-width: min(220px, 42vw);
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
}

.store-header .nav-brand .brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(var(--color-primary-rgb), 0.08);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.15);
}

.store-header .nav-brand .brand-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.store-header .nav-brand .brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .store-header .nav-brand {
    max-width: 280px;
    font-size: 1.1rem;
  }

  .store-header .nav-brand .brand-logo {
    width: 48px;
    height: 48px;
  }
}

.search-bar-wrap {
  flex: 1;
  position: relative;
  max-width: 720px;
}

.search-bar-main {
  display: flex;
  gap: 0;
  border: 2px solid var(--color-primary);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.search-bar-main .input-control {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.search-bar-main .btn-search-submit {
  border: none;
  background: var(--color-primary);
  color: #fff;
  padding: 0 1.25rem;
  font-weight: 600;
  white-space: nowrap;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  max-height: 360px;
  overflow-y: auto;
  z-index: 1050;
}

.search-suggestion-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.search-suggestion-item:hover {
  background: rgba(var(--color-primary-rgb), 0.06);
}

.search-suggestion-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.search-suggestion-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-suggestions-all {
  display: block;
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  color: var(--color-primary);
}

.search-suggestions-empty {
  padding: 1rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.category-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0 0.75rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.category-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--color-primary-rgb), 0.25);
  background: #fff;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.category-chip:hover,
.category-chip.active {
  background: rgba(var(--color-primary-rgb), 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.category-chip--promo {
  border-color: #f5c2c7;
  background: linear-gradient(135deg, #fff5f5, #fff9e6);
  color: #b02a37;
  font-weight: 600;
}

.category-chip--promo:hover,
.category-chip--promo.active {
  background: linear-gradient(135deg, #ffe3e3, #fff3cd);
  border-color: #dc3545;
  color: #842029;
}

        .category-chip-promo-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #dc3545;
            flex-shrink: 0;
            box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
        }
        .catalog-promos-quick.active,
        .catalog-promos-quick:hover {
            border-color: #dc3545;
            color: #842029;
            background: #fff5f5;
        }

.store-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-cart-header {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
  background: #fff;
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.mobile-search-sticky {
  display: none;
  padding: 0.5rem 0;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* Cart drawer */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.cart-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  background: #fff;
  z-index: 1070;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header,
.cart-drawer-footer {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cart-drawer-footer {
  border-bottom: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: auto;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.cart-drawer-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
}

.cart-drawer-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  align-items: start;
}

.cart-drawer-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-drawer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-drawer-qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.cart-drawer-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.cart-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1055;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.cart-drawer-open {
  overflow: hidden;
}

/* Compact product cards */
.grid-products {
  gap: 0.85rem;
  margin: 1.25rem 0;
}

@media (min-width: 1200px) {
  .grid-products {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }
}

.product-card-compact {
  padding: 0.75rem;
  gap: 0.5rem;
}

.product-card-compact .product-thumb {
  max-height: 140px;
  margin: -0.25rem -0.25rem 0;
}

.product-card-compact .product-thumb img {
  height: 140px;
  border-radius: 8px 8px 0 0;
}

.product-card-compact .title {
  font-size: 0.88rem;
  min-height: 2.4em;
  line-height: 1.25;
}

.product-card-compact .price-primary {
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.product-card-compact .card-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: auto;
}

.product-card-compact .card-actions .btn {
  flex: 1;
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

.badge-stock-ok {
  background: #dcfce7;
  color: #166534;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.badge-stock-low {
  background: #fef3c7;
  color: #92400e;
  font-size: 0.7rem;
}

.catalogo-scroll-sentinel {
  height: 4px;
  width: 100%;
  pointer-events: none;
  flex-shrink: 0;
}

.catalog-filters-panel {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-base);
  padding: 1rem;
  margin-bottom: 1rem;
}

.catalog-filters-panel .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.catalog-filters-panel .filter-field {
  flex: 1;
  min-width: 140px;
}

/* Sidebar filtros — catálogo */
.catalog-filters-sidebar {
  position: sticky;
  top: 7.5rem;
  align-self: flex-start;
}

.catalog-filters-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.catalog-filters-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(180deg, rgba(var(--color-primary-rgb), 0.06) 0%, #fff 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.catalog-filters-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary-dark, var(--color-primary));
  letter-spacing: 0.02em;
  text-transform: none;
}

.catalog-filters-reset {
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.catalog-filters-reset:hover {
  color: var(--color-primary-dark, var(--color-primary));
}

.catalog-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.45rem 0.85rem 0;
}

.catalog-filters-card .catalog-active-filters:empty,
.catalog-filters-card .catalog-active-filters[hidden] {
  display: none;
  padding: 0;
}

.catalog-filters-card .catalog-active-filters:not([hidden]):not(:empty) {
  padding-bottom: 0.35rem;
}

.catalog-active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(var(--color-primary-rgb), 0.25);
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary-dark, var(--color-primary));
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.catalog-active-filter-chip span {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
}

.filter-section {
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.catalog-filters-card .filter-section + .filter-section {
  padding-top: 0.4rem;
}

.filter-section:last-of-type {
  border-bottom: none;
}

.filter-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.filter-section-body {
  display: block;
}

.catalog-filters-card .filter-section-body {
  display: grid;
  gap: 0.35rem;
}

.catalog-filters-card .filter-section-body.filter-price-range {
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.filter-label {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4b5563;
  line-height: 1.1;
}

.catalog-filters-card .catalog-select-wrapper {
  margin: 0;
  flex: none;
  width: 100%;
  min-height: 0;
  position: relative;
}

.catalog-filters-card .catalog-select-wrapper::after {
  top: auto;
  bottom: 0.5rem;
  right: 0.55rem;
  transform: none;
  font-size: 0.68rem;
  line-height: 1;
}

.catalog-filters-card .input-control-sm,
.catalog-filters-card .filter-select {
  display: block;
  width: 100%;
  height: 34px;
  min-height: 0;
  margin: 0;
  padding: 0.35rem 1.6rem 0.35rem 0.55rem;
  font-size: 0.84rem;
  line-height: 1.2;
  box-sizing: border-box;
}

.filter-select {
  width: 100%;
}

.filter-price-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.filter-input-prefix {
  position: relative;
}

.filter-input-prefix .input-control {
  padding-left: 1.45rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  width: 100%;
  height: 34px;
  min-height: 0;
  box-sizing: border-box;
}

.filter-input-prefix-symbol {
  left: 0.55rem;
  font-size: 0.8rem;
}

.filter-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-pill {
  flex: 1;
  min-width: calc(50% - 0.2rem);
  border: 1px solid rgba(var(--color-primary-rgb), 0.25);
  background: #fff;
  color: var(--color-primary);
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-pill:hover {
  background: rgba(var(--color-primary-rgb), 0.06);
}

.filter-pill.active,
.btn-filter.active {
  background: rgba(var(--color-primary-rgb), 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary-dark, var(--color-primary));
  box-shadow: inset 0 0 0 1px rgba(var(--color-primary-rgb), 0.15);
}

.catalog-filters-footer {
  padding: 0.55rem 0.85rem 0.65rem;
  background: #fafafa;
}

/* Móvil: botón y drawer de filtros */
.catalog-listing-toolbar {
  margin-bottom: 0.85rem;
}

.btn-filters-mobile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
  background: #fff;
  color: var(--color-primary);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.btn-filters-mobile-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1055;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.filter-drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.filter-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(360px, 92vw);
  height: 100vh;
  background: #fff;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.12);
}

.filter-drawer.open {
  transform: translateX(0);
}

.filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  flex-shrink: 0;
}

.filter-drawer-close {
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0 0.25rem;
}

.filter-drawer-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-drawer-body .catalog-filters-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.filter-drawer-body .catalog-filters-card-header {
  display: none;
}

body.filter-drawer-open {
  overflow: hidden;
}

/* Product detail page */
.product-detail-page {
  padding-bottom: 2rem;
}

.product-gallery-main {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-base);
  overflow: hidden;
  background: #fff;
  cursor: zoom-in;
}

.product-gallery-main img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.product-gallery-main.zoomed img {
  transform: scale(1.75);
  cursor: zoom-out;
}

.product-gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.product-specs dt {
  font-weight: 600;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.product-specs dd {
  margin-bottom: 0.65rem;
}

/* Checkout stepper */
.checkout-stepper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.checkout-step {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 0.65rem;
  border-radius: 10px;
  background: #f3f4f6;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
}

.checkout-step.active {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary-dark);
}

.checkout-step.done {
  background: #dcfce7;
  color: #166534;
}

@media (max-width: 991.98px) {
  .mobile-search-sticky {
    display: block;
  }
  .search-bar-wrap.d-none.d-lg-block {
    display: none !important;
  }
  .store-header-top {
    flex-wrap: wrap;
  }
  .store-nav-links .d-none.d-lg-inline {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .cart-fab {
    display: none;
  }
}
