/* =========================================================
   LAYOUT — Creaciones Alejandra
   Hero, grillas, secciones, sidebar, footer, páginas
   ========================================================= */

/* ===========================
   HERO (CSS-only carousel)
   =========================== */
.hero-inputs { display: none; }

.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--color-bg-blush);
}

.hero-slider {
  display: flex;
  width: 300%;
  transition: transform 0.5s ease;
}

.hero-slide {
  width: calc(100% / 3);
  min-height: 480px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .hero-slide { min-height: 560px; }
}

.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 8s ease;
}

.hero-slide:hover .hero-slide-bg {
  transform: scale(1.04);
}

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(45, 27, 36, 0.55) 0%,
    rgba(245, 81, 127, 0.15) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: var(--space-8) var(--container-pad);
  max-width: 600px;
  color: #fff;
}

.hero-content .script {
  color: var(--color-primary-light);
  display: block;
  margin-bottom: var(--space-3);
}

.hero-content h1 {
  color: #fff;
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.hero-content p {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: var(--space-6);
  max-width: 440px;
  font-weight: 300;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Carousel radio controls */
#slide1:checked ~ .hero .hero-slider { transform: translateX(0); }
#slide2:checked ~ .hero .hero-slider { transform: translateX(calc(-100% / 3)); }
#slide3:checked ~ .hero .hero-slider { transform: translateX(calc(-200% / 3)); }

/* Dots */
.hero-dots {
  position: absolute;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  z-index: 2;
}

.hero-dots label {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all var(--transition);
}

.hero-dots label:hover { background: rgba(255,255,255,0.8); }

#slide1:checked ~ .hero .hero-dots label[for="slide1"],
#slide2:checked ~ .hero .hero-dots label[for="slide2"],
#slide3:checked ~ .hero .hero-dots label[for="slide3"] {
  background: #fff;
  width: 24px;
  border-radius: var(--radius-pill);
}

/* ===========================
   PRODUCTS GRID
   =========================== */
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
}

@media (min-width: 1024px) {
  .products-grid { grid-template-columns: repeat(4, 1fr); }
}

.products-grid--3 {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 640px) {
  .products-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .products-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ===========================
   CATEGORY GRID
   =========================== */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-5); }
}

@media (min-width: 1024px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-slow);
}

.category-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.category-card:hover img {
  transform: scale(1.06);
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(45,27,36,0.7) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-4) var(--space-5);
}

.category-card-title {
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  margin-bottom: var(--space-1);
}

.category-card-count {
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  font-family: var(--font-sans);
}

/* ===========================
   HORIZONTAL SCROLL CAROUSEL
   =========================== */
.carousel-scroll {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-4);
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.carousel-scroll::-webkit-scrollbar { height: 4px; }
.carousel-scroll::-webkit-scrollbar-track { background: transparent; }
.carousel-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.carousel-scroll .product-card {
  flex-shrink: 0;
  width: 220px;
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .carousel-scroll .product-card { width: 260px; }
}

/* ===========================
   INSTAGRAM GRID
   =========================== */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

@media (min-width: 640px) {
  .instagram-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }
}

@media (min-width: 1024px) {
  .instagram-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.instagram-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.instagram-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.instagram-item:hover img { transform: scale(1.08); }

.instagram-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 81, 127, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.instagram-item:hover .instagram-item-overlay { opacity: 1; }

.instagram-item-overlay span {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===========================
   CATEGORY PAGE LAYOUT
   =========================== */
.category-layout {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
}

.category-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .category-sidebar {
    display: block;
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--space-16) + 2rem);
  }

  .category-content { flex: 1; min-width: 0; }
}

.filter-group {
  margin-bottom: var(--space-6);
}

.filter-group-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
  min-height: 36px;
}

.filter-option:hover { color: var(--color-primary); }

.filter-option input[type="checkbox"] {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Mobile filter toggle */
.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}

@media (min-width: 1024px) {
  .filter-toggle-btn { display: none; }
}

/* ===========================
   PRODUCT PAGE LAYOUT
   =========================== */
.product-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .product-layout {
    flex-direction: row;
    gap: var(--space-12);
  }

  .product-gallery-col {
    flex: 1;
    max-width: 560px;
  }

  .product-info-col {
    flex: 1;
    min-width: 0;
  }
}

/* ===========================
   CART LAYOUT
   =========================== */
.cart-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .cart-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .cart-items-col { flex: 1; }

  .cart-summary-col {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
  }
}

/* Cart table */
.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 0 0 var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  text-align: left;
}

.cart-table td {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.cart-item-product {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-name {
  font-weight: 400;
  font-size: 0.9rem;
  margin-bottom: var(--space-1);
}

.cart-item-variant {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.cart-remove {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  transition: color var(--transition);
}

.cart-remove:hover { color: var(--color-primary); }

/* Mobile cart: stack layout */
@media (max-width: 639px) {
  .cart-table thead { display: none; }

  .cart-table td {
    display: block;
    padding: var(--space-2) 0;
    border: none;
  }

  .cart-table tr {
    display: block;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border-light);
  }

  .cart-item-product { align-items: flex-start; }
}

/* ===========================
   CHECKOUT LAYOUT
   =========================== */
.checkout-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .checkout-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .checkout-form-col { flex: 1; }

  .checkout-summary-col {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
  }
}

/* Checkout step panels */
.checkout-step {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.checkout-step-header {
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-blush);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.checkout-step-num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.checkout-step-num.pending {
  background: var(--color-border);
  color: var(--color-text-muted);
}

.checkout-step-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.checkout-step-body {
  padding: var(--space-5);
}

/* ===========================
   AUTH PAGES (Login / Registro)
   =========================== */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--container-pad);
  background: var(--color-bg-blush);
}

.auth-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  padding: var(--space-8) var(--space-6);
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-logo img {
  height: 64px;
  margin: 0 auto;
}

.auth-title {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-title h1 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: var(--space-2);
}

.auth-title p {
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.auth-divider {
  text-align: center;
  margin: var(--space-5) 0;
  position: relative;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--color-border);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-footer {
  text-align: center;
  margin-top: var(--space-5);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-primary);
  font-weight: 500;
}

/* ===========================
   PAGINATION
   =========================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-8) 0;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition);
  border: 1.5px solid transparent;
  cursor: pointer;
}

.page-btn:hover {
  background: var(--color-bg-blush);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.page-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: var(--color-footer-bg);
  color: rgba(255,255,255,0.75);
  padding: var(--space-12) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

.footer-brand img {
  height: 40px;
  margin-bottom: var(--space-4);
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  max-width: 260px;
}

.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  color: rgba(255,255,255,0.7);
}

.footer-social a:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--space-4);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--color-primary-light); }

.footer-payment-icons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.payment-icon {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--space-4) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom p {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}

.footer-bottom a {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}

.footer-bottom a:hover { color: var(--color-primary-light); }

/* ===========================
   SEARCH PAGE
   =========================== */
.search-header {
  padding: var(--space-8) 0 var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: var(--space-8);
}

.search-bar-lg {
  display: flex;
  align-items: center;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  max-width: 600px;
  transition: border-color var(--transition);
  background: var(--color-white);
}

.search-bar-lg:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(245,81,127,0.1);
}

.search-bar-lg input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  background: none;
  color: var(--color-text);
}

.search-bar-lg button {
  padding: 0.85rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  font-size: 0.88rem;
  transition: background var(--transition);
  white-space: nowrap;
}

.search-bar-lg button:hover { background: var(--color-primary-hover); }

/* ===========================
   ORDER CONFIRMATION
   =========================== */
.confirmation-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--container-pad);
}

.confirmation-card {
  text-align: center;
  max-width: 560px;
  width: 100%;
}

.check-animation {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.check-animation svg {
  stroke: #fff;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawCheck 0.4s ease 0.3s forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

/* ===========================
   404 PAGE
   =========================== */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--container-pad);
  text-align: center;
}

.error-content {
  max-width: 480px;
}

.error-butterfly {
  margin: 0 auto var(--space-6);
  opacity: 0.25;
}

.error-code {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 15vw, 8rem);
  color: var(--color-primary);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: var(--space-4);
}
