/*
Theme Name:   Astra Child - Calmly
Description:  Child theme de Astra para calmlypet.com. Contiene el CSS que antes vivía en Apariencia -> Personalizar -> CSS adicional.
Author:       Calmly
Template:     astra
Version:      1.0.0
Text Domain:  astra-child
*/

/* ==========================================================================
   1. Fondo crema en toda la web excepto Home (id 106)
   ========================================================================== */
body:not(.page-id-106),
body:not(.page-id-106) .site-content,
body:not(.page-id-106) #content,
body:not(.page-id-106) .ast-container {
  background-color: #F5F2EC !important;
}

/* ==========================================================================
   2. Buscador minimalista - página Shop
   El bloque core/search es dinámico: WordPress regenera su HTML al guardar
   y descarta estilos inline, por eso se estiliza solo por clase externa.
   ========================================================================== */
.calmly-shop-search .wp-block-search__inside-wrapper {
  border: none !important;
  border-bottom: 1px solid #1B2A3A !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.calmly-shop-search .wp-block-search__input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1B2A3A !important;
  font-size: 13px !important;
  padding: 4px 2px !important;
  width: 140px !important;
}

.calmly-shop-search .wp-block-search__input::placeholder {
  color: #9aa4b0 !important;
}

.calmly-shop-search button.wp-block-search__button {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 2px !important;
  min-width: auto !important;
  width: auto !important;
  height: auto !important;
}

.calmly-shop-search button.wp-block-search__button svg {
  fill: #1B2A3A !important;
  width: 15px !important;
  height: 15px !important;
}

/* ==========================================================================
   3. Filtro de categorías - página Shop
   Enlaces simples que usan el filtrado nativo de WooCommerce (?product_cat=),
   sin tocar la plantilla del loop de productos.
   ========================================================================== */
.calmly-shop-cats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  max-width: 1100px;
  margin: 20px auto 8px;
  padding: 0 24px;
}

.calmly-shop-cats__link {
  color: #5a6878;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.calmly-shop-cats__link:hover {
  color: #1B2A3A;
  border-bottom-color: #D4A24C;
}

/* ==========================================================================
   4. Carrusel de tarjetas - Home
   Reemplaza el slideshow de Jetpack: tarjetas ligeramente inclinadas,
   flechas circulares a los lados, deslizamiento suave, fondo transparente.
   ========================================================================== */
.calmly-cards-carousel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 480px;
  max-width: 100%;
  background: transparent;
}

.calmly-cards-carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.calmly-cards-carousel__card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 340px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(27, 42, 58, 0.18);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
  will-change: transform, opacity;
}

.calmly-cards-carousel__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.calmly-cards-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e5e0d5;
  background: #F5F2EC;
  color: #1B2A3A;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.calmly-cards-carousel__arrow:hover {
  background: #ffffff;
  border-color: #D4A24C;
}

.calmly-cards-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.calmly-cards-carousel__arrow--prev {
  left: 12px;
}

.calmly-cards-carousel__arrow--next {
  right: 12px;
}

@media (max-width: 600px) {
  .calmly-cards-carousel {
    height: 360px;
  }

  .calmly-cards-carousel__card {
    width: 190px;
    height: 250px;
  }
}

/* ==========================================================================
   5. Hero - Home (primera sección de la página, antes del carrusel).
   v3: composición estática de 7 tarjetas (4 lifestyle + 3 producto) a
   distintas escalas alrededor del texto central, más una luna 3D. Sin
   animaciones todavía — versión para aprobar composición antes de mover
   a parallax/scroll-driven.
   ========================================================================== */
.calmly-hero3 {
  position: relative;
  width: 100%;
  background-color: #F5F2EC;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 0 96px;
}

.calmly-hero3__watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18vw;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(27, 42, 58, 0.035);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.calmly-hero3__stage {
  position: relative;
  z-index: 1;
  width: min(1400px, 94vw);
  height: clamp(600px, 64vw, 740px);
}

.calmly-hero3__card {
  position: absolute;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(27, 42, 58, 0.12);
  background: #ffffff;
}

.calmly-hero3__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.calmly-hero3__card--product {
  border-radius: 12px;
}

.calmly-hero3__card--1 { left: 4%;  top: 10%; width: 260px; height: 330px; transform: rotate(-3deg); z-index: 2; }
.calmly-hero3__card--2 { left: 80%; top: 8%;  width: 240px; height: 300px; transform: rotate(3deg);  z-index: 2; }
.calmly-hero3__card--3 { left: 0%;  top: 58%; width: 210px; height: 260px; transform: rotate(4deg);  z-index: 1; }
.calmly-hero3__card--4 { left: 84%; top: 56%; width: 210px; height: 260px; transform: rotate(-4deg); z-index: 1; }
.calmly-hero3__card--5 { left: 22%; top: 80%; width: 130px; height: 130px; transform: rotate(3deg);  z-index: 3; }
.calmly-hero3__card--6 { left: 68%; top: 82%; width: 120px; height: 120px; transform: rotate(-3deg); z-index: 3; }
.calmly-hero3__card--7 { left: 45%; top: 84%; width: 110px; height: 110px; transform: rotate(-2deg); z-index: 3; }

.calmly-hero3__moon-3d {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  z-index: 4;
}

.calmly-hero3__moon-3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.calmly-hero3__moon-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.9;
}

.calmly-hero3__text {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  width: min(680px, 82vw);
  text-align: center;
  z-index: 10;
}

.calmly-hero3__eyebrow {
  color: #B8863A;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin: 0 0 20px;
}

.calmly-hero3__title {
  color: #1B2A3A;
  font-size: clamp(36px, 4.6vw, 68px);
  line-height: 1.1;
  font-weight: 600;
  margin: 0 0 28px;
}

.calmly-hero3__accent {
  color: #D4A24C;
}

.calmly-hero3__cta {
  display: inline-block;
  background-color: #D4A24C;
  color: #1B2A3A;
  text-decoration: none;
  padding: 15px 34px;
  border-radius: 2px;
  font-size: 15px;
  letter-spacing: 0.5px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.calmly-hero3__cta:hover {
  background-color: #B8863A;
  color: #ffffff;
}

@media (max-width: 780px) {
  .calmly-hero3 {
    padding: 56px 20px 40px;
  }

  .calmly-hero3__stage {
    position: static;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .calmly-hero3__moon-3d {
    position: static;
    transform: none;
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    order: 1;
  }

  .calmly-hero3__text {
    position: static;
    transform: none;
    width: 100%;
    order: 2;
    margin-bottom: 24px;
  }

  .calmly-hero3__card {
    position: static !important;
    transform: none !important;
    order: 3;
    margin: 6px !important;
    display: inline-block;
  }

  .calmly-hero3__card-row {
    order: 3;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .calmly-hero3__card--1,
  .calmly-hero3__card--2 {
    width: 130px !important;
    height: 170px !important;
  }

  .calmly-hero3__card--5 {
    width: 110px !important;
    height: 110px !important;
  }

  .calmly-hero3__card--3,
  .calmly-hero3__card--4,
  .calmly-hero3__card--6,
  .calmly-hero3__card--7 {
    display: none;
  }

  .calmly-hero3__watermark {
    font-size: 24vw;
  }
}

/* DEBUG TEMPORAL - quitar antes de terminar */
.calmly-hero3 { outline: 4px solid red !important; }
.calmly-hero3__stage { outline: 4px solid blue !important; }
.calmly-hero3__moon-3d { outline: 2px solid lime !important; background: yellow !important; }
.calmly-hero3__text { outline: 2px solid magenta !important; }
.entry-content { outline: 6px solid orange !important; }
.entry-header { outline: 6px solid cyan !important; background: rgba(0,255,255,0.3) !important; }
article.post-106 { outline: 6px dashed purple !important; }
