/* ==========================================================================
   SebasPeru — diseño v2: cabecera Marketplace y pie v2.
   Se carga después de main.css si header_variant = marketplace o footer_variant = v2.
   Referencias: docs/design-v2/Home-2.dc.html (cabecera) y Home-1.dc.html (pie).
   ========================================================================== */

/* ==========================================================================
   Cabecera Marketplace
   ========================================================================== */

/* ---------- Barra superior ---------- */
.sp-topbar.sp-topbar--mkt { display: block; background: var(--sp-highlight); color: var(--sp-ink); font-size: 13px; font-weight: 700; }
.sp-topbar__mkt {
	max-width: 1320px; margin: 0 auto; padding: 8px 24px;
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; line-height: 1.5;
}
.sp-topbar__promo { min-width: 0; }
.sp-topbar__links { display: flex; flex-wrap: wrap; gap: 20px; }
.sp-topbar__links a { color: var(--sp-ink); }
.sp-topbar__links a:hover { color: var(--sp-ink); text-decoration: underline; }

/* ---------- Barra principal ---------- */
.sp-header.sp-header--mkt { position: relative; z-index: 50; background: var(--sp-primary); color: #fff; border-bottom: 0; }
.sp-mkt__inner {
	max-width: 1320px; margin: 0 auto; padding: 18px 24px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px;
}
.sp-header--mkt .sp-burger { display: none; }
.sp-header--mkt .sp-logo--header { padding-right: 0; border-right: 0; }
.sp-header--mkt .sp-logo--header .sp-logo__img { height: var(--sp-logo-h, 44px); max-width: 260px; }

/* Buscador con selector de categoría */
.sp-search.sp-search--mkt {
	flex: 1 1 420px; max-width: none; height: 50px; display: flex; align-items: stretch;
	background: #fff; border: 0; border-radius: 12px; overflow: visible;
}
.sp-search.sp-search--mkt:focus-within { border: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, .45); }
.sp-search--mkt .sp-search__cat {
	flex: 0 1 auto; max-width: 180px; height: 100%; margin: 0; padding: 0 34px 0 14px;
	border: 0; border-right: 1px solid #e1e7f0; border-radius: 12px 0 0 12px; background-color: #fff;
	color: var(--sp-ink); font-size: 13.5px; font-weight: 700; cursor: pointer;
	-webkit-appearance: none; appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230f1c2e' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
	text-overflow: ellipsis;
}
.sp-search--mkt .sp-search__cat:focus-visible { outline: 2px solid var(--sp-primary); outline-offset: -2px; }
.sp-search--mkt .sp-search__input {
	flex: 1; min-width: 0; height: 100%; padding: 0 16px; border: 0; border-radius: 0; background: transparent;
	font-family: inherit; font-size: 15px; color: var(--sp-ink);
}
.sp-search--mkt:not(.has-cat) .sp-search__input { border-radius: 12px 0 0 12px; }
.sp-search--mkt .sp-search__input::placeholder { color: #64748b; }
.sp-search--mkt .sp-search__input:focus-visible { outline: 2px solid var(--sp-primary); outline-offset: -2px; }
.sp-header--mkt :focus-visible { outline-color: #fff; }
.sp-header--mkt .sp-search--mkt :focus-visible { outline-color: var(--sp-primary); }
.sp-topbar--mkt :focus-visible { outline-color: var(--sp-ink); }
.sp-search--mkt .sp-search__btn {
	flex: 0 0 60px; width: 60px; height: 100%; padding: 0; justify-content: center;
	background: var(--sp-highlight); color: var(--sp-ink); border-radius: 0 12px 12px 0;
}
.sp-search--mkt .sp-search__btn:hover { background: #f5c518; color: var(--sp-ink); }
.sp-search--mkt .sp-search__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sp-search--mkt .sp-live { top: calc(100% + 6px); left: 0; right: 0; }

/* Acciones: cuenta, favoritos y carrito */
.sp-mkt__actions { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.sp-header--mkt .sp-acc.sp-acc--mkt { display: flex; align-items: center; gap: 10px; color: #fff; text-align: left; min-height: 44px; }
.sp-header--mkt .sp-acc--mkt:hover { color: #fff; }
.sp-header--mkt .sp-acc--mkt .sp-acc__ic { display: block; }
.sp-acc--mkt .sp-acc__col { line-height: 1.2; }
.sp-acc--mkt .sp-acc__col small { font-size: 12.5px; color: #fff; }
.sp-acc--mkt .sp-acc__col b { font-size: 14px; font-weight: 800; }
.sp-fav-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; color: #fff; }
.sp-fav-link:hover { color: var(--sp-highlight); }

.sp-header--mkt .sp-cart-btn.sp-cart-btn--mkt { min-height: 44px; padding: 0; background: transparent; border: 0; border-radius: 8px; color: #fff; }
.sp-header--mkt .sp-cart-btn--mkt:hover { background: transparent; }
.sp-cart-data--mkt { gap: 10px; }
.sp-cart-data--mkt .sp-cart-btn__ic { position: relative; display: flex; }
.sp-cart-data--mkt .sp-cart-count,
.sp-cart-data--mkt .sp-cart-count.is-empty {
	position: absolute; top: -6px; right: -8px; display: flex; align-items: center; justify-content: center;
	min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
	background: var(--sp-highlight); color: var(--sp-ink); font-size: 11px; font-weight: 900; line-height: 1;
}
.sp-cart-data--mkt .sp-cart-btn__col { line-height: 1.2; }
.sp-cart-data--mkt .sp-cart-btn__col small { font-size: 12.5px; letter-spacing: 0; opacity: 1; }
.sp-cart-data--mkt .sp-cart-btn__col b { font-size: 14px; font-weight: 800; }

/* ---------- Barra de navegación ---------- */
.sp-mkt-nav { position: relative; z-index: 45; background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
.sp-mkt-nav__inner {
	position: relative; max-width: 1320px; margin: 0 auto; padding: 0 24px;
	display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700;
}
.sp-allcats-btn {
	display: flex; align-items: center; gap: 10px; flex-shrink: 0; height: 46px; padding: 0 18px; margin-right: 12px;
	background: var(--sp-ink); color: #fff; font-weight: 800; white-space: nowrap;
}
.sp-allcats-btn:hover, .sp-allcats-btn[aria-expanded="true"] { background: #1d3050; color: #fff; }
.sp-allcats-btn:focus-visible { outline: 2px solid var(--sp-primary); outline-offset: 2px; }
.sp-mkt-nav__quick { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.sp-mkt-nav__quick a { display: block; padding: 12px 14px; color: var(--sp-ink); white-space: nowrap; }
.sp-mkt-nav__quick a:hover { color: var(--sp-primary); }
.sp-mkt-nav__offers {
	margin-left: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
	padding: 12px 14px; color: #c23400; white-space: nowrap;
}
.sp-mkt-nav__offers:hover { color: #9a2900; }

/* ---------- Megamenú "Todas las categorías" (escritorio) ---------- */
@media (min-width: 1024px) {
	.sp-nav.sp-nav--mkt {
		position: absolute; top: 100%; left: 24px; z-index: 60; width: 260px; padding: 8px 0;
		display: none; overflow: visible; background: #fff; border-radius: 0 0 14px 14px;
		box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
	}
	.sp-nav.sp-nav--mkt.is-dropdown-open { display: block; }
	.sp-nav--mkt .sp-nav__inner { display: block; max-width: none; min-height: 0; padding: 0; }
	.sp-nav--mkt .sp-nav__links { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; }
	.sp-nav--mkt .sp-nav__item { position: static; display: block; }
	.sp-nav--mkt .sp-nav__link {
		display: flex; justify-content: space-between; align-items: center; gap: 10px;
		min-height: 44px; height: auto; padding: 10px 16px; white-space: normal;
		color: var(--sp-ink); font-size: 14px; font-weight: 700; line-height: 1.3;
	}
	.sp-nav--mkt .sp-nav__link:hover,
	.sp-nav--mkt .sp-nav__item:hover > .sp-nav__link,
	.sp-nav--mkt .sp-nav__item:focus-within > .sp-nav__link,
	.sp-nav--mkt .sp-nav__item.is-current > .sp-nav__link { background: var(--sp-bg); color: var(--sp-primary); }
	.sp-nav--mkt .sp-nav__chev,
	.sp-nav--mkt .sp-nav__item:hover .sp-nav__chev { transform: rotate(-90deg); opacity: .7; }
	.sp-nav--mkt .sp-nav__toggle,
	.sp-nav--mkt .sp-nav__head,
	.sp-nav--mkt .sp-nav__account,
	.sp-nav--mkt .sp-nav__offers { display: none; }
	.sp-nav--mkt .sp-mega {
		top: 0; left: 100%; min-height: 100%; width: min(720px, calc(100vw - 340px)); min-width: 0 !important;
		padding: 20px 24px; border: 0; border-radius: 0 14px 14px 0; transform: none;
		box-shadow: 12px 12px 30px rgba(15, 23, 42, .18);
	}
	.sp-nav--mkt .sp-mega__inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; }
	.sp-nav--mkt .sp-mega__col { min-width: 0; padding: 0; border: 0; }
}

/* ---------- Tableta y móvil ---------- */
@media (max-width: 1023px) {
	.sp-mkt__inner { gap: 12px 16px; }
	.sp-header--mkt .sp-burger {
		display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px;
		border-radius: 10px; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .28); color: #fff;
	}
	.sp-header--mkt .sp-logo--header .sp-logo__img { height: var(--sp-logo-h, 44px); }
	.sp-search.sp-search--mkt { flex: 1 1 300px; }
	.sp-mkt__actions { gap: 4px; }
	.sp-header--mkt .sp-acc.sp-acc--mkt,
	.sp-header--mkt .sp-cart-btn.sp-cart-btn--mkt { justify-content: center; width: 44px; height: 44px; }
	.sp-acc--mkt .sp-acc__col,
	.sp-cart-data--mkt .sp-cart-btn__col {
		position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
		overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
	}

	/* La barra blanca se oculta; #sp-nav queda como cajón lateral (main.css + main.js). */
	.sp-mkt-nav { position: static; z-index: auto; background: transparent; box-shadow: none; }
	.sp-mkt-nav__inner { position: static; height: 0; padding: 0; }
	.sp-mkt-nav__inner > :not(#sp-nav) { display: none !important; }
}

@media (max-width: 767px) {
	.sp-topbar__mkt { justify-content: center; padding: 6px 16px; }
	.sp-topbar__promo { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
	.sp-topbar__links { display: none; }
	.sp-mkt__inner { padding: 10px 16px 12px; gap: 10px 8px; }
	.sp-header--mkt .sp-logo--header .sp-logo__img { height: 32px; max-width: 160px; }
	.sp-search.sp-search--mkt { order: 5; flex: 1 1 100%; height: 48px; }
	.sp-search--mkt .sp-search__cat { display: none; }
	.sp-search--mkt .sp-search__input { border-radius: 12px 0 0 12px; }
}

/* ==========================================================================
   Pie de página v2
   ========================================================================== */
.sp-footer2 { background: var(--sp-footer); color: #fff; font-size: 14px; }
.sp-footer2 a { color: #fff; }
.sp-footer2 a:hover { color: #fff; text-decoration: underline; }
.sp-footer2 :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Newsletter */
.sp-footer2__news { border-bottom: 1px solid rgba(255, 255, 255, .18); }
.sp-footer2__news-inner {
	max-width: 1216px; margin: 0 auto; padding: 28px 24px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 16px 40px;
}
.sp-footer2__news-txt { flex: 1 1 360px; min-width: 0; }
.sp-footer2__news-txt b { display: block; font-size: 20px; font-weight: 800; line-height: 1.3; }
.sp-footer2__news-txt p { margin: 4px 0 0; font-size: 13.5px; color: #fff; line-height: 1.5; }
.sp-footer2__news-form { flex: 1 1 420px; min-width: 0; }
.sp-footer2 .sp-news {
	max-width: none; margin: 0 0 10px; padding: 0; border: 0; gap: 8px; display: flex; align-items: stretch;
}
.sp-footer2 .sp-news input[type=email] {
	flex: 1; min-width: 0; height: 48px; padding: 0 16px; border: 0; border-radius: 10px;
	background: #fff; color: var(--sp-ink); font-size: 15px; line-height: 1.2;
}
.sp-footer2 .sp-news input[type=email]::placeholder { color: #64748b; }
.sp-footer2 .sp-news button {
	flex-shrink: 0; height: 48px; padding: 0 22px; border-radius: 10px;
	background: var(--sp-highlight); color: var(--sp-ink); font-size: 14px; font-weight: 800;
}
.sp-footer2 .sp-news button:hover { background: #f5c518; color: var(--sp-ink); }
.sp-footer2 .sp-news__check { color: #fff; font-size: 12.5px; align-items: center; min-height: 24px; }
.sp-footer2 .sp-news__check input { width: 18px; height: 18px; margin: 0; }
.sp-footer2 .sp-news__check a { color: #fff; padding-block: 4px; } /* área táctil ≥ 24px sin mover el texto */
.sp-footer2 .sp-news__msg.is-error { color: #fff; background: rgba(185, 28, 28, .85); padding: 6px 10px; border-radius: 8px; display: inline-block; }
.sp-footer2 .sp-news__msg.is-ok { color: var(--sp-ink); background: #bbf7d0; padding: 6px 10px; border-radius: 8px; display: inline-block; }

/* Columnas */
.sp-footer2__grid {
	max-width: 1216px; margin: 0 auto; padding: 44px 24px;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px;
}
.sp-footer2__col { min-width: 0; }
h3.sp-footer2__t { margin: 0 0 16px; font-size: 19px; font-weight: 800; line-height: 1.3; color: #fff; }
.sp-footer2__links { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.sp-footer2__links a { display: inline-flex; align-items: center; min-height: 24px; }
.sp-footer2__info { display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.sp-footer2__wa, .sp-footer2__tel { display: inline-flex; align-items: center; gap: 12px; min-height: 24px; align-self: flex-start; }
.sp-footer2__wa .sp-icon { color: #4ade80; }
.sp-footer2__info b { display: block; font-size: 14px; }
.sp-footer2__info span, .sp-footer2__email a { font-size: 14px; }
.sp-footer2__email a { display: inline-flex; min-height: 24px; align-items: center; overflow-wrap: anywhere; }
.sp-footer2__hours span { display: block; }
.sp-footer2__sub { display: block; margin-bottom: 8px; font-size: 14px; }
.sp-footer2__sub ~ .sp-footer2__sub { margin-top: 18px; }

/* Insignias de pago del pie v2 */
.sp-paycards--f2 { gap: 6px; }
.sp-paycards--f2 .sp-pc {
	width: 46px; min-width: 46px; height: 28px; padding: 0; border: 0; border-radius: 5px;
	background: #fff; color: #1a1f71; font: 800 10px/1 Arial, sans-serif; letter-spacing: 0;
}
.sp-paycards--f2 .sp-pc--visa { font-style: italic; font-size: 12px; }
.sp-paycards--f2 .sp-pc--yape { background: #742284; color: #fff; }
.sp-paycards--f2 .sp-pc--plin { background: #0b7f93; color: #fff; }
.sp-paycards--f2 .sp-pc--bcp { background: #002a8d; color: #fff; }
.sp-paycards--f2 .sp-pc--amex { background: #1f72cd; color: #fff; }
.sp-paycards--f2 .sp-pc--diners { color: #0079be; }
.sp-paycards--f2 .sp-pc--bbva { background: #004481; color: #fff; }
.sp-paycards--f2 .sp-pc--interbank { background: #00a94f; color: #fff; }

.sp-claims {
	display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 40px;
	background: #fff; border-radius: 4px; text-align: center;
}
.sp-footer2 a.sp-claims, .sp-footer2 a.sp-claims:hover { color: var(--sp-ink); text-decoration: none; }
.sp-claims span { font-size: 9px; font-weight: 800; line-height: 1.1; }

.sp-footer2__social { display: flex; flex-wrap: wrap; gap: 12px; }
.sp-footer2__social a {
	width: 40px; height: 40px; border-radius: 50%; background: #fff;
	display: inline-flex; align-items: center; justify-content: center;
}
.sp-footer2 .sp-footer2__social a, .sp-footer2 .sp-footer2__social a:hover { color: var(--sp-primary); text-decoration: none; }
.sp-footer2__social a:hover { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }

/* Franja inferior */
.sp-footer2__bottom { background: var(--sp-footer-dark); padding: 16px; text-align: center; font-size: 14px; text-transform: uppercase; }

@media (max-width: 767px) {
	.sp-footer2__news-inner { padding: 24px 16px; }
	.sp-footer2__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 32px 16px; }
	.sp-footer2 .sp-news { flex-wrap: wrap; }
	.sp-footer2 .sp-news input[type=email] { flex: 1 1 100%; }
	.sp-footer2 .sp-news button { flex: 1 1 100%; }
}
