/* -------------------------
   Header principal (cpt-header)
------------------------- */
:root {
  --color-primario: #ff91b7;
}

.cpt-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(249, 249, 249, 0.85);
  box-sizing: border-box;
  overflow: visible;
}

/* -------------------------
   Header top row (mobile)
------------------------- */
.cpt-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 54px;
  padding: 0 20px;
}

.cpt-logo {
  display: flex;
  align-items: center;
}

.cpt-menu-icon {
  width: 28px;
  height: 28px;
  cursor: pointer;
}

/* Brand: hidden on mobile */
.cpt-header-brand,
.cpt-header-brand--inline {
  display: none;
}

/* Desktop search trigger: hidden on mobile */
.cpt-search-trigger {
  display: none;
}

/* Desktop nav: hidden on mobile */
.cpt-desktop-nav {
  display: none;
}

/* Desktop favorites: hidden on mobile */
.cpt-desktop-fav {
  display: none !important;
}

/* Desktop categories mega: hidden by default */
.cpt-cats-mega {
  display: none;
}

/* -------------------------
   Nav icons (right side)
------------------------- */
.cpt-nav-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cpt-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  background: none;
}

.cpt-icon:hover {
  background-color: #f5f5f7;
}

.cpt-icon img:not(.cpt-user-img) {
  width: 22px;
  height: 22px;
}

.cpt-user-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Cart badge */
.cpt-notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--color-primario);
  color: white;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.cpt-notification-badge:empty {
  display: none !important;
}

/* -------------------------
   Full-screen mobile menu
------------------------- */
.cpt-fullmenu {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 2000;
  background: #fff;
  /* Hidden by default — animate in */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
}

.cpt-fullmenu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Both panels: absolute, fill the menu, animate between them */
.cpt-fullmenu-nav,
.cpt-fullmenu-cats {
  position: absolute;
  inset: 0;
  display: flex;
  background: #fff;
  transition: transform 0.3s ease, opacity 0.25s ease;
}

/* Nav panel: vertical list */
.cpt-fullmenu-nav {
  flex-direction: column;
}

/* Categories panel: horizontal — strip | list side by side */
.cpt-fullmenu-cats {
  flex-direction: row;
}

/* Panel 1: Nav list — default visible */
.cpt-fullmenu-nav {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.cpt-fullmenu.cats-view .cpt-fullmenu-nav {
  transform: translateX(-28px);
  opacity: 0;
  pointer-events: none;
}

/* Panel 2: Categories — default hidden to the right */
.cpt-fullmenu-cats {
  transform: translateX(22px);
  opacity: 0;
  pointer-events: none;
}

.cpt-fullmenu.cats-view .cpt-fullmenu-cats {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Menu header row */
.cpt-fullmenu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.cpt-fullmenu-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cpt-fullmenu-logo {
  height: 24px;
  max-width: 100px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.cpt-fullmenu-brand-name {
  font-weight: 600;
  font-size: 1rem;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cpt-fullmenu-close {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.15s;
}

.cpt-fullmenu-close:active {
  background: #f5f5f7;
}

.cpt-fullmenu-close img {
  width: 20px;
  height: 20px;
}

/* Nav links list */
.cpt-fullmenu-links {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
  -webkit-overflow-scrolling: touch;
}

.cpt-fullmenu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  text-decoration: none;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 500;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s;
}

.cpt-fullmenu-item:active {
  background-color: #f5f5f7;
}

.cpt-fullmenu-item--offer {
  color: var(--color-primario);
  font-weight: 600;
}

.cpt-fullmenu-item--offer .cpt-fullmenu-icon {
  color: var(--color-primario);
}

.cpt-fullmenu-item--offer:active {
  background-color: color-mix(in srgb, var(--color-primario) 8%, #fff);
}

.cpt-fullmenu-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #6b7280;
}

.cpt-fullmenu-icon path {
  stroke: currentColor;
}

.cpt-fullmenu-chevron {
  margin-left: auto;
  color: #9ca3af;
  flex-shrink: 0;
}

/* Separator before Categorías */
.cpt-fullmenu-cats-trigger {
  border-top: 1px solid #f3f4f6;
  margin-top: 8px;
  padding-top: 20px;
}

/* -------------------------
   Categories split view
------------------------- */
.cpt-icons-strip {
  width: 64px;
  background: #f9f9fb;
  border-right: 1px solid #efefef;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 2px;
  flex-shrink: 0;
}

.cpt-strip-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: background-color 0.15s;
}

.cpt-strip-btn:active {
  background-color: #ebebeb;
}

.cpt-strip-btn img {
  width: 20px;
  height: 20px;
  opacity: 0.55;
}

.cpt-strip-btn svg {
  opacity: 0.55;
}

.cpt-strip-btn--offer {
  color: var(--color-primario);
  background-color: color-mix(in srgb, var(--color-primario) 10%, transparent);
}

.cpt-strip-btn--offer svg {
  opacity: 1;
}

/* Back button sits at the bottom */
.cpt-strip-back {
  margin-top: auto;
  color: var(--color-primario);
  background-color: color-mix(in srgb, var(--color-primario) 10%, transparent);
}

.cpt-strip-back svg {
  opacity: 1;
  color: var(--color-primario);
}

/* Categories list panel */
.cpt-cats-panel {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cpt-cats-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.cpt-cats-panel-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.cpt-cats-panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.cpt-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  text-decoration: none;
  color: #374151;
  font-size: 0.95rem;
  border-bottom: 1px solid #f9f9f9;
  transition: background-color 0.15s;
}

.cpt-cat-link:active {
  background-color: #f5f5f7;
}

.cpt-cat-link svg {
  color: #d1d5db;
  flex-shrink: 0;
}

.cpt-cat-link--all {
  font-weight: 600;
  color: var(--color-primario);
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
}

.cpt-cat-link--all svg {
  color: var(--color-primario);
}

/* Sub-item (inside a group) */
.cpt-cat-link--sub {
  padding: 11px 20px 11px 36px;
  font-size: 0.9rem;
  color: #6b7280;
  background: #fff;
}

/* Group accordion */
.cpt-cat-group-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #374151;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s;
}

.cpt-cat-group-trigger:active {
  background-color: #f5f5f7;
}

.cpt-cat-group-arrow {
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.cpt-cat-group-trigger.is-open .cpt-cat-group-arrow {
  transform: rotate(180deg);
}

.cpt-cat-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.cpt-cat-group-items.is-open {
  max-height: 600px;
}

/* =============== SEARCH OVERLAY =============== */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px) saturate(110%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease;
  overflow-y: auto;
  padding: 56px 20px 40px;
}

.search-overlay.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e6e6e6;
  box-shadow: 0 18px 40px rgba(31, 41, 51, 0.12);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(-6px);
  transition:
    transform 0.35s ease,
    opacity 0.3s ease;
  opacity: 0;
}

.search-overlay.show .search-box {
  transform: translateY(0);
  opacity: 1;
}

#searchInput {
  flex: 1;
  border: none;
  font-size: 1rem;
  color: #2a2a2a;
  outline: none;
  background: transparent;
  font-weight: 500;
}

#searchInput::placeholder {
  color: #8c8c8c;
}

#closeSearch {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

#closeSearch:hover {
  transform: rotate(90deg) scale(1.05);
  opacity: 0.7;
}

#closeSearch img {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.search-results {
  margin-top: 28px;
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fadeIn 0.35s ease;
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: opacity, transform;
}

.search-results.is-updating {
  opacity: 0.6;
  transform: translateY(4px);
}

.search-results-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b6067;
}

.search-results-title--recommended {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.search-results-title--recommended::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primario, #c0a0b0);
}

.search-results-count {
  color: #8b7a84;
  font-weight: 600;
}

.search-results-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.result-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #ececec;
  padding: 14px;
  text-decoration: none;
  color: #2a2a2a;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(31, 41, 51, 0.08);
}

.result-item:hover {
  border-color: #d9d9d9;
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(31, 41, 51, 0.14);
}

.result-item .result-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.5;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.result-item .result-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.badge-offer {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--color-primario);
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(31, 41, 51, 0.2);
}

.badge-agotado {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #6c757d;
  color: #fff;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(31, 41, 51, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.result-item .info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 48px;
}

.result-item h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.price,
.price-offer {
  color: #1f2933;
  font-weight: 600;
  font-size: 0.86rem;
}

.price-old {
  color: #9b8f96;
  font-weight: 500;
  font-size: 0.76rem;
  text-decoration: line-through;
}

.no-results {
  text-align: center;
  color: #8a7b83;
  font-size: 0.95rem;
  margin-top: 16px;
}

@media (max-width: 720px) {
  .search-overlay {
    padding: 48px 16px 32px;
  }
  .search-box {
    max-width: 100%;
  }
  .search-results {
    max-width: 100%;
  }
  .search-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
