/* style.css */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600&family=Montserrat:wght@300;400;500;600&display=swap");

:root {
  --color-bg: #eeeceb;
  --color-neutral: #b5ada3;
  --color-accent: #d2d1d9;
  --color-text: #151414;

  --font-title: "Cormorant Garamond", serif;
  --font-body: "Montserrat", sans-serif;
}

body {
  background: #efe8dd;
  color: var(--color-text);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
}

.logo {
  width: 10%;
  height: 10%;
  margin-left: 44%;
}

.productos-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
  padding: 40px 0;
}

/* Contenedor general */
.producto-card {
  width: 310px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  cursor: pointer;
}
/* Efecto hover */
.producto-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}
/* --- IMÁGENES --- */
.producto-card .img-container {
  position: relative;
  width: 312px;
  height: 372px;
  overflow: hidden;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f6f4; /* Fondo neutro para imágenes pequeñas */
}

.producto-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.5s ease;
}

/* Si la imagen no llena el alto o ancho, que se contenga sin deformarse */
.producto-card img.landscape {
  object-fit: contain;
}

.producto-card img.portrait {
  object-fit: contain;
}

.producto-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, opacity 0.5s ease;
}

/* Segunda imagen (hover) */
.producto-card img.second {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

/* Hover → zoom + cambio de imagen */
.producto-card:hover img.first {
  transform: scale(1.08);
  opacity: 0;
}
.producto-card:hover img.second {
  opacity: 1;
  transform: scale(1.08);
}
/* Si solo hay una imagen → solo zoom */
.producto-card.solo-una:hover img.first {
  transform: scale(1.08);
  filter: brightness(1.1);
  opacity: 1;
}
/* Si hay dos imágenes → cambio + zoom */
.producto-card.con-dos:hover img.first {
  transform: scale(1.08);
  opacity: 0;
}
.producto-card.con-dos:hover img.second {
  opacity: 1;
  transform: scale(1.08);
}
.producto-card:hover {
  box-shadow: 0 12px 35px rgba(165, 130, 110, 0.25);
}

/* --- INFORMACIÓN --- */
.producto-card h3 {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 500;
  color: var(--color-text);
  margin: 16px 14px 6px;
}

.producto-card h5 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: #888;
  margin: 0 14px 10px;
  line-height: 1.4;
}

.precio {
  font-weight: 600;
  font-size: 15px;
  margin: 0 14px 15px;
  color: var(--color-text);
}

/* --- ÍCONO DE CARRITO --- */
.add-cart {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: #7a5540;
  color: white;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: 0.3s ease;
}
.add-cart:hover {
  background: #b08b7c;
}

/* Ícono SVG más sutil */
.add-cart svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.btn {
  padding: 8px 14px;
  border: 1px solid var(--color-text);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  display: inline-block;
  transition: 0.3s;
}
.btn:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

/* TOP BAR */
/* OVERRIDES FINALES DEL HERO (se cargan después de header.php) */
.hero {
  position: relative;
  text-align: center;
  background: linear-gradient(
      rgba(239, 232, 221, 0.85),
      rgba(239, 232, 221, 0.85)
    ),
    url("assets/img/bg-texture.jpg") center/cover no-repeat;
}

.hero .hero-title {
  font-family: "Cormorant Garamond", serif !important;
  font-size: 4.2rem;
  font-weight: 500;
  letter-spacing: 1px;
  color: #ad836e8f !important;
  margin: 0 0 1rem;
}

.hero .hero-subtitle {
  font-family: "Montserrat", sans-serif !important;
  font-size: 15px;
  color: #5e524794 !important;
  max-width: 650px;
  margin: 0 auto;
}

/* Sutileza de marca: logo muy tenue de fondo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/img/logo.png") center/40% no-repeat;
  opacity: 0.06;
  z-index: 0;
}
.hero .hero-title,
.hero .hero-subtitle {
  position: relative;
  z-index: 1;
}

/* IZQUIERDA - BUSCADOR */
.search-box {
  display: flex;
  align-items: center;
  border: 1px solid #9a9288;
  border-radius: 8px;
  padding: 6px 10px;
  background: #ffffff63;
}
.search-box input {
  border: none;
  background: none;
  font-family: var(--font-body);
  outline: none;
}
.search-box button {
  border: none;
  background: none;
  cursor: pointer;
}

/* LOGO CENTRADO */
.header-center .logo {
  height: 70px;
  display: block;
  margin: auto;
}

/* DERECHA - ICONOS */
.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-link img {
  width: 22px;
  cursor: pointer;
}

/* MENÚ SECUNDARIO */
.menu {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 12px 0;
  background: #f2ece4;
}
.menu a {
  text-decoration: none;
  color: #3f3a36;
  font-family: var(--font-body);
  font-weight: 500;
  transition: 0.3s;
}
.menu a:hover {
  color: #6a4eff;
}

/*categorias*/
/* Encabezado de Categoría */
.categoria-header {
  text-align: center;
}

.categoria-header h1 {
  font-family: var(--font-title);
  font-size: 48px;
  font-weight: 400;
  margin-bottom: 6px;
  color: var(--color-text);
}

.categoria-header p {
  font-family: var(--font-body);
  color: var(--color-neutral);
  font-size: 16px;
  letter-spacing: 0.5px;
  margin: 0;
}

/* Más aire en página de categoría */
.products-section {
  padding-top: 20px;
  padding-bottom: 80px;
}

.products-section h2 {
  font-size: 13px;
  margin-left: 2%;
  color: #7a5540;
}

/* === BOTÓN DE CARRITO AURA === */
.add-cart {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: #7a5540; /* tono arena oscuro */
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
}

.add-cart:hover {
  background: #b08b7c;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* === ÍCONO DEL CARRITO === */
.add-cart i {
  color: #fff;
  font-size: 18px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.add-cart:hover i {
  transform: scale(1.12);
  opacity: 0.95;
}

/*carrito actualizado*/
.cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#cart-count {
  position: absolute;
  top: 0px;
  right: -25px;
  background: #7a5540;
  color: white;
  font-size: 11px;
  font-family: "Montserrat", sans-serif;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.alerta-carrito {
  position: fixed;
  top: 30px;
  right: 30px;
  background: #7a5540;
  color: #fff;
  font-family: "Montserrat", sans-serif;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: fadeInOut 2s ease forwards;
  z-index: 9999;
}
@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  10%,
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/*categorias*/
/* Dropdown Categorías */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  color: #000;
  text-decoration: none;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 180px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  z-index: 10;
}

.dropdown-content a {
  color: #333;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid #eee;
  transition: background 0.2s ease;
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background-color: #f6f4f2;
  color: #7a5540;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown:hover .dropbtn {
  color: #7a5540;
}

.btn-admin {
  display: inline-block;
  background-color: #ad836f;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 22px;
  margin-left: 42%;
}
.btn-admin:hover {
  background-color: #d5cd7b;
}
