/*
 * Playmobileros — tema hijo de Hummingbird (PrestaShop 9.2)
 *
 * Hummingbird usa @layer: estas reglas, al ir SIN capa, ganan a las normales del padre.
 * Pero un !important sin capa PIERDE contra las utilidades !important de Bootstrap
 * (d-none, order-2, ms-auto...). Donde el padre pone utilidades, se cambia la plantilla.
 *
 * Índice
 *   1. Fuentes y variables
 *   2. Base
 *   3. Botones y etiquetas
 *   4. Cabecera (aviso, barra fina, cabecera principal, menú)
 *   5. Banner principal (ps_imageslider)
 *   6. Bloques de portada (ps_customtext: tarjetas y mundos)
 *   7. Secciones de productos y tarjetas
 *   8. Pie
 */

/* 1. Fuentes y variables ------------------------------------------------- */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Marca */
  --pm-brand: #189bbc;          /* turquesa Playmobileros */
  --pm-brand-dark: #0e7590;
  --pm-brand-deep: #0a4f63;
  --pm-brand-soft: #dff1f6;     /* fondo de página */
  --pm-accent: #f26b1d;         /* naranja: avisos, ofertas */
  --pm-accent-dark: #d4560c;
  --pm-sun: #ffc93c;
  --pm-red: #e63946;
  --pm-green: #2a9d5c;
  --pm-ink: #1d2b36;
  --pm-muted: #5b6b78;
  --pm-card: #ffffff;
  --pm-radius: 1rem;
  --pm-radius-lg: 1.5rem;
  --pm-shadow: 0 2px 10px rgba(10, 79, 99, 0.08);
  --pm-shadow-hover: 0 8px 24px rgba(10, 79, 99, 0.16);
  --pm-font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Bootstrap */
  --bs-primary: var(--pm-brand);
  --bs-primary-rgb: 24, 155, 188;
  --bs-link-color: var(--pm-brand-dark);
  --bs-link-color-rgb: 14, 117, 144;
  --bs-link-hover-color: var(--pm-brand-deep);
  --bs-link-hover-color-rgb: 10, 79, 99;
  --bs-body-font-family: var(--pm-font);
  --bs-body-color: var(--pm-ink);
  --bs-body-bg: var(--pm-brand-soft);
  --bs-border-radius: 0.75rem;
  --bs-border-radius-lg: var(--pm-radius);
}

/* 2. Base ---------------------------------------------------------------- */

body {
  font-family: var(--pm-font);
  background-color: var(--pm-brand-soft);
  color: var(--pm-ink);
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4 {
  font-family: var(--pm-font);
  font-weight: 900;
  letter-spacing: -0.01em;
}

.page-content,
.columns-container {
  background: transparent;
}

/* Bloques blancos redondeados para el contenido de páginas internas */
#main .page-content:not(.page-content--home),
#left-column .block,
.card {
  border-radius: var(--pm-radius);
}

/* 3. Botones y etiquetas -------------------------------------------------- */

.btn {
  font-weight: 800;
  border-radius: 999px;
}

.btn-primary {
  --bs-btn-bg: var(--pm-brand-dark);
  --bs-btn-border-color: var(--pm-brand-dark);
  --bs-btn-hover-bg: var(--pm-brand-deep);
  --bs-btn-hover-border-color: var(--pm-brand-deep);
  --bs-btn-active-bg: var(--pm-brand-deep);
  --bs-btn-active-border-color: var(--pm-brand-deep);
  --bs-btn-disabled-bg: var(--pm-brand);
  --bs-btn-disabled-border-color: var(--pm-brand);
}

.btn-outline-primary {
  --bs-btn-color: var(--pm-brand-dark);
  --bs-btn-border-color: var(--pm-brand-dark);
  --bs-btn-hover-bg: var(--pm-brand-dark);
  --bs-btn-hover-border-color: var(--pm-brand-dark);
  --bs-btn-active-bg: var(--pm-brand-deep);
  --bs-btn-active-border-color: var(--pm-brand-deep);
  border-width: 2px;
}

.product-flags .badge {
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.35em 0.75em;
  text-transform: none;
}

.product-flags .badge.new { background-color: var(--pm-brand-dark); }
.product-flags .badge.discount,
.product-flags .badge.on-sale { background-color: var(--pm-red); }
.product-flags .badge.online-only { background-color: var(--pm-green); }
.product-flags .badge.out_of_stock { background-color: var(--pm-muted); }

/* 4. Cabecera ------------------------------------------------------------ */

/* 4.1 Barra de aviso */
.pm-promo {
  background: var(--pm-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}

.pm-promo__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 2.5rem;
  padding-block: 0.375rem;
  text-align: center;
}

.pm-promo__text {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.pm-promo__text .material-icons { font-size: 1.125rem; }

.pm-promo__btn {
  flex: none;
  padding: 0.2rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  color: var(--pm-accent-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.pm-promo__btn:hover { background: var(--pm-ink); color: #fff; }

/* 4.2 Barra fina (contacto, idioma, moneda) */
.pm-utility {
  background: var(--pm-brand-deep);
  color: #fff;
  font-size: 0.8125rem;
}

.pm-utility a,
.pm-utility .dropdown-toggle,
.pm-utility .btn,
.pm-utility .header-block__action-btn,
.pm-utility .material-icons {
  color: #fff;
}

.pm-utility .header-top__right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

/* 4.3 Cabecera principal */
.header {
  background: var(--pm-brand);
  box-shadow: 0 2px 12px rgba(10, 79, 99, 0.18);
}

.pm-header {
  background: var(--pm-brand);
  color: #fff;
}

.pm-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  min-height: 4.25rem;
}

/* El buscador trae order-2 (utilidad !important): se ordena el resto alrededor */
.pm-header__row > .ps-mainmenu--desktop { order: 0; }
.pm-header__logo { order: 1; display: flex; align-items: center; }
.pm-header__row > #_desktop_ps_searchbar { flex: 1 1 auto; max-width: 40rem; }
.pm-header__row > .ps-searchbar--mobile { order: 3; margin-left: auto; }
.pm-header__actions { order: 3; display: flex; align-items: center; gap: 0.25rem; }

.pm-header__logo img,
.pm-header__logo .logo {
  max-height: 3rem;
  width: auto;
}

/* Móvil y tableta: todo en una fila (el menú es el botón hamburguesa) */
@media (max-width: 1199.98px) {
  .pm-header__row { flex-wrap: nowrap; column-gap: 0.5rem; }
  .pm-header__logo { min-width: 0; flex: 0 1 auto; }
}

@media (max-width: 575.98px) {
  .pm-header__row { min-height: 3.75rem; }
  .pm-header__logo img,
  .pm-header__logo .logo { max-height: 2.25rem; }
  .pm-header .header-block__action-btn { padding-inline: 0.25rem; }
  .pm-promo { font-size: 0.8125rem; }
  .pm-promo__text .material-icons { display: none; }
}

/* Iconos y textos de cabecera en blanco */
.pm-header .header-block__action-btn,
.pm-header .header-block__icon,
.pm-header .header-block__title,
.pm-header .menu-toggle,
.pm-header .ps-mainmenu__mobile-toggle .material-icons,
.pm-header .ps-searchbar--mobile .material-icons {
  color: #fff;
}

.pm-header .header-block__action-btn:hover,
.pm-header .menu-toggle:hover {
  color: var(--pm-sun);
}

.pm-header .header-block__badge {
  background: var(--pm-accent);
  color: #fff;
  font-weight: 800;
}

/* Buscador redondeado y grande */
.pm-header .ps-searchbar,
.pm-header .ps-searchbar__form {
  width: 100%;
}

.pm-header .ps-searchbar__input {
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  padding-inline-start: 2.75rem;
  background: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 2px transparent;
}

.pm-header .ps-searchbar__input:focus {
  box-shadow: inset 0 0 0 2px var(--pm-sun);
}

.pm-header .ps-searchbar__magnifier {
  color: var(--pm-brand-dark);
}

/* 4.4 Menú en escritorio: segunda fila blanca a todo el ancho */
@media (min-width: 1200px) {
  .pm-header__row > .ps-mainmenu--desktop {
    order: 10;
    flex: 0 0 100%;
    background: #fff;
    /* fondo blanco a sangre sin salirse del contenedor */
    box-shadow: 0 0 0 100vmax #fff;
    clip-path: inset(0 -100vmax);
  }

  .pm-header .ps-mainmenu__tree {
    gap: 0.25rem;
  }

  .pm-header .ps-mainmenu__tree-link {
    padding: 0.9rem 0.75rem;
    color: var(--pm-ink);
    font-weight: 800;
    font-size: 0.9375rem;
  }

  .pm-header .ps-mainmenu__tree > li:hover .ps-mainmenu__tree-link,
  .pm-header .ps-mainmenu__tree > li.current .ps-mainmenu__tree-link {
    color: var(--pm-brand-dark);
    box-shadow: inset 0 -3px 0 var(--pm-brand);
  }

  .pm-header .submenu {
    border-radius: 0 0 var(--pm-radius) var(--pm-radius);
    box-shadow: var(--pm-shadow-hover);
  }
}

/* 5. Banner principal ------------------------------------------------------ */

.pm-hero {
  margin-block: 1.5rem;
}

.pm-hero .carousel {
  border-radius: var(--pm-radius-lg);
  overflow: hidden;
  box-shadow: var(--pm-shadow);
}

.pm-hero__slide {
  display: block;
  background: var(--pm-brand-dark);
}

.pm-hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pm-hero__slide--split {
  display: grid;
  grid-template-columns: 1fr;
  color: #fff;
}

.pm-hero__slide--c0 { background: var(--pm-red); }
.pm-hero__slide--c1 { background: var(--pm-brand-dark); }
.pm-hero__slide--c2 { background: var(--pm-accent); }
.pm-hero__slide--c3 { background: var(--pm-brand-deep); }

.pm-hero__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.75rem 1.5rem 2.75rem;
}

.pm-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
  line-height: 1.05;
}

.pm-hero__desc {
  font-size: 1.125rem;
  font-weight: 600;
}

.pm-hero__desc p:last-child { margin-bottom: 0; }

.pm-hero__btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.pm-hero__btn:hover {
  background: #fff;
  color: var(--pm-ink);
}

@media (min-width: 768px) {
  .pm-hero__slide--split {
    grid-template-columns: 2fr 3fr;
    min-height: 22rem;
  }

  .pm-hero__text { padding: 2.5rem 2.5rem 3rem; }
}

.pm-hero .carousel-indicators [data-bs-target] {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: #fff;
}

/* 6. Bloques de portada (HTML de ps_customtext) --------------------------- */

.ps-customtext { margin-block: 1.5rem; }

/* 6.1 Tarjetas promocionales */
.pm-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 992px) {
  .pm-tiles { grid-template-columns: repeat(3, 1fr); }
  .pm-tile--wide { grid-column: span 2; }
}

.pm-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 11rem;
  padding: 1.25rem;
  border-radius: var(--pm-radius-lg);
  background: var(--pm-brand-dark);
  color: #fff;
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--pm-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.pm-tile:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--pm-shadow-hover);
}

.pm-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.pm-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 60%);
  z-index: 1;
}

.pm-tile > :not(img) { position: relative; z-index: 2; }

.pm-tile__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
}

.pm-tile__badge {
  position: absolute !important;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--pm-sun);
  color: var(--pm-ink);
  font-weight: 900;
}

.pm-tile--red { background: var(--pm-red); }
.pm-tile--orange { background: var(--pm-accent); }
.pm-tile--green { background: var(--pm-green); }
.pm-tile--deep { background: var(--pm-brand-deep); }

/* 6.2 Franja de mundos (líneas de producto) */
.pm-worlds {
  margin-top: 2rem;
  text-align: center;
}

.pm-worlds__title {
  margin-bottom: 1rem;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
}

.pm-worlds__list {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0.25rem 0.25rem 1rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.pm-worlds__list li { flex: 0 0 auto; scroll-snap-align: start; }

.pm-world {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 7.5rem;
  color: var(--pm-ink);
  font-weight: 800;
  text-decoration: none;
}

.pm-world img,
.pm-world__icon {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: var(--pm-shadow);
  border: 4px solid #fff;
  transition: border-color 0.15s, transform 0.15s;
}

.pm-world__icon {
  display: grid;
  place-items: center;
  font-size: 2.25rem;
}

.pm-world:hover { color: var(--pm-brand-dark); }
.pm-world:hover img,
.pm-world:hover .pm-world__icon {
  border-color: var(--pm-brand);
  transform: scale(1.04);
}

/* 7. Secciones de productos y tarjetas ------------------------------------ */

.page-content--home > section,
.page-content--home .module-products {
  margin-block: 2rem;
}

.section-title {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  font-weight: 900;
  text-align: center;
  margin-bottom: 1.25rem;
}

.module-products__buttons {
  display: flex;
  justify-content: center;
}

/* Tarjeta de producto */
.product-miniature__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.75rem;
  border-radius: var(--pm-radius);
  background: var(--pm-card);
  box-shadow: var(--pm-shadow);
  transition: box-shadow 0.15s, transform 0.15s;
}

.product-miniature__inner:hover {
  box-shadow: var(--pm-shadow-hover);
  transform: translateY(-2px);
}

.product-miniature__top {
  border-radius: calc(var(--pm-radius) - 0.25rem);
  overflow: hidden;
  background: #fff;
}

.product-miniature__bottom {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-miniature__infos { flex: 1; }

.product-miniature__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.5rem;
  color: var(--pm-ink);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.product-miniature__title:hover { color: var(--pm-brand-dark); }

.product-miniature__price {
  font-size: 1.375rem;
  font-weight: 900;
  color: var(--pm-ink);
}

.product-miniature__regular-price {
  color: var(--pm-muted);
  text-decoration: line-through;
}

.product-miniature__discount-price + .product-miniature__price,
.product-miniature__prices:has(.product-miniature__regular-price) .product-miniature__price {
  color: var(--pm-red);
}

/* Botón «Añadir al carrito» a todo el ancho; el selector de cantidad se oculta pero
   sigue en el formulario (core.js lo envía con la cantidad mínima). */
.product-miniature__form {
  display: flex;
  width: 100%;
}

.product-miniature__form .quantity-button {
  display: none;
}

.product-miniature__add,
.product-miniature__details {
  flex: 1;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.75rem;
  border-radius: 999px;
}

.product-miniature__add-text {
  display: inline;
}

.product-miniature__actions {
  margin-top: 0.75rem;
}

/* 8. Pie ----------------------------------------------------------------- */

.footer__before {
  background: var(--pm-brand-dark);
  color: #fff;
}

.footer__main {
  background: var(--pm-brand-deep);
  color: #dbeef4;
}

.footer__main a,
.footer__main .footer-block__title,
.footer__before a,
.footer__before .h3,
.footer__before h2,
.footer__before p {
  color: #fff;
}

.footer__main a:hover { color: var(--pm-sun); }
