/* ============================================
   TIENDA - Estilo Premium (LensCrafters-inspired)
   ============================================ */

.shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-top: 96px;
  width: 100%;
  background: #fff;
}

/* ---- SIDEBAR ---- */
.shop-sidebar {
  border-right: 1px solid #eee;
  background: #fff;
  padding: 32px 24px;
  position: sticky;
  top: 96px;
  height: calc(100vh - 96px);
  overflow-y: auto;
}
.shop-sidebar::-webkit-scrollbar { width: 2px; }
.shop-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}
.sidebar-header h3 {
  font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--texto);
}
.sidebar-clear {
  font-size: 0.7rem; color: var(--texto-3);
  background: none; border: none; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  text-decoration: underline;
}
.sidebar-clear:hover { color: var(--verde); }

.filter-search {
  display: flex; align-items: center; gap: 8px;
  background: #f8f8f8; border-radius: 8px;
  padding: 9px 12px; border: 1.5px solid transparent;
  transition: all 0.25s; margin-bottom: 8px;
}
.filter-search:focus-within { border-color: var(--verde); background: #fff; }
.filter-search svg { width: 14px; height: 14px; color: #bbb; flex-shrink: 0; }
.filter-search input {
  border: none; background: none; font-size: 0.82rem;
  font-family: inherit; color: var(--texto); outline: none; width: 100%;
}
.filter-search input::placeholder { color: #bbb; }

.filter-block { margin-bottom: 0; }
.filter-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border: none; background: none;
  font-size: 0.72rem; font-weight: 600; color: var(--texto);
  cursor: pointer; font-family: inherit;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s; text-transform: uppercase; letter-spacing: 1px;
}
.filter-toggle svg { width: 10px; height: 10px; color: #ccc; transition: transform 0.3s; }
.filter-toggle.collapsed svg { transform: rotate(-90deg); }
.filter-toggle:hover { color: var(--verde); }

.filter-options { padding: 8px 0 4px; display: none; }
.filter-options.open { display: block; }

.filter-check {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; cursor: pointer;
  font-size: 0.78rem; color: #555; transition: color 0.2s;
}
.filter-check:hover { color: var(--verde); }
.filter-check input[type="checkbox"],
.filter-check input[type="radio"] {
  width: 14px; height: 14px; accent-color: var(--verde);
  cursor: pointer; flex-shrink: 0; margin: 0;
}
.filter-count {
  margin-left: auto; font-size: 0.62rem; color: #bbb;
  background: #f5f5f5; padding: 1px 6px; border-radius: 50px;
}

.color-swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid #ddd; flex-shrink: 0;
}

/* ---- MAIN ---- */
.shop-main {
  padding: 32px 40px 80px;
  background: #fff;
  min-height: 100vh;
}

.shop-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px; gap: 12px; flex-wrap: wrap;
  padding-bottom: 20px; border-bottom: 1px solid #eee;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.shop-count { font-size: 0.82rem; color: #999; font-weight: 400; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

.view-toggles { display: none; }

.shop-sort {
  padding: 8px 16px; border-radius: 6px;
  border: 1px solid #ddd; background: #fff;
  font-size: 0.8rem; font-family: inherit; color: #555; cursor: pointer;
}
.shop-sort:focus { border-color: var(--verde); outline: none; }

.mobile-filter-btn {
  display: none; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px;
  border: 1px solid #ddd; background: #fff;
  font-size: 0.8rem; font-weight: 600; font-family: inherit;
  color: #555; cursor: pointer;
}
.mobile-filter-btn svg { width: 15px; height: 15px; }
.mobile-filter-btn:hover { border-color: var(--verde); color: var(--verde); }

/* ---- GRID ---- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
}

/* ---- CARDS PREMIUM ---- */
.shop-card {
  background: transparent;
  position: relative;
  transition: all 0.3s ease;
}
.shop-card a.card-link {
  text-decoration: none; color: inherit; display: block;
}

.shop-card .card-img {
  width: 100%; aspect-ratio: 4/3; position: relative;
  background: #f7f7f7; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; transition: all 0.3s ease;
}
.shop-card:hover .card-img {
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.shop-card .card-img img {
  width: 85%; height: 85%; object-fit: contain;
  transition: all 0.4s ease;
}
.shop-card:hover .card-img img {
  transform: scale(1.05);
}
.shop-card .card-img svg { width: 60px; height: 60px; opacity: 0.08; }

/* Secondary image on hover */
.shop-card .card-img .img-secondary {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
  padding: 7.5%;
  opacity: 0; transition: opacity 0.4s ease;
}
.shop-card:hover .card-img .img-primary { opacity: 0; }
.shop-card:hover .card-img .img-secondary { opacity: 1; }
.shop-card:hover .card-img .img-primary.no-swap { opacity: 1; }

/* Favorite button (only heart, no cart button on card) */
.card-actions {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 6px; z-index: 3;
  opacity: 0;
  transition: opacity 0.25s;
}
.shop-card:hover .card-actions { opacity: 1; }

.card-action-btn {
  width: 36px; height: 36px; padding: 7px;
  background: rgba(255,255,255,0.9); color: #999;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card-action-btn svg { width: 100%; height: 100%; stroke-width: 1.5; stroke: currentColor !important; fill: none !important; }
.card-action-btn:hover { background: #fff; color: var(--verde); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.card-action-btn.fav-active { background: #fff; color: #e11d48; }
.card-action-btn.fav-active svg { fill: #e11d48 !important; stroke: #e11d48 !important; }
.card-action-btn.added { background: var(--verde) !important; color: #fff !important; }

/* Tags */
.shop-card .card-discount {
  position: absolute; top: 10px; left: 10px;
  background: var(--verde); color: #fff;
  padding: 3px 8px; border-radius: 3px;
  font-size: 0.62rem; font-weight: 700; z-index: 2;
  letter-spacing: 0.2px; line-height: 1.3;
  width: auto; max-width: fit-content;
  display: inline-block;
}
.shop-card .card-new {
  position: absolute; top: 10px; left: 10px;
  background: #111; color: #fff;
  padding: 3px 8px; border-radius: 3px;
  font-size: 0.62rem; font-weight: 700; z-index: 2;
  letter-spacing: 0.2px; line-height: 1.3;
  width: auto; max-width: fit-content;
  display: inline-block;
}

/* Info below image */
.shop-card .card-body {
  padding: 14px 4px 0;
}
.shop-card .card-brand {
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  color: #aaa; margin-bottom: 4px;
}
.shop-card .card-body h3 {
  font-size: 0.92rem; margin-bottom: 6px;
  font-weight: 500; font-family: 'Inter', sans-serif;
  color: #222; line-height: 1.4;
}
.shop-card .card-desc {
  font-size: 0.75rem; color: #999;
  line-height: 1.5; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
}
.shop-card .card-meta {
  display: none;
}
.shop-card .card-price {
  display: flex; align-items: center; gap: 8px;
  margin-top: 4px;
}
.shop-card .price-old {
  font-size: 0.78rem; color: #bbb; text-decoration: line-through;
}
.shop-card .price-new {
  font-size: 0.95rem; font-weight: 700; color: var(--verde);
}

.shop-empty {
  text-align: center; padding: 80px 24px; color: #999;
  grid-column: 1 / -1; font-size: 0.92rem;
}

.sidebar-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.35); display: none;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.open { display: block; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1100px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
}

@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .shop-sidebar {
    position: fixed; top: 0; left: -300px; width: 280px;
    height: 100vh; z-index: 95;
    transition: left 0.3s cubic-bezier(.4,0,.2,1);
    padding-top: 24px;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
  }
  .shop-sidebar.open { left: 0; }
  .mobile-filter-btn { display: flex; }
  .shop-main { padding: 20px 20px 60px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
}

@media (max-width: 480px) {
  .shop-grid { grid-template-columns: 1fr; gap: 24px; }
  .shop-card .card-img { aspect-ratio: 4/3; }
  .shop-card .card-desc { display: none; }
  .card-actions { opacity: 1; }
  .shop-main { padding: 16px 16px 60px; }
  .shop-toolbar { margin-bottom: 20px; padding-bottom: 14px; }
}
