/* --- Variables de Color (Luxury Pink Theme) --- */
:root {
  --luxury-pink: #D9A9C1; /* Rosa principal (más suave) */
  --accent-pink: #E5C1CD; /* Rosa secundario (más claro) */
  --dark-text: #4a3b40;    /* Texto oscuro (un marrón/gris rosado) */
  --price-color: #A94064;  /* Un rosa más fuerte para precios */
  --background: #FEFBFD;   /* Fondo casi blanco, con un toque de rosa */
  --border-color: #EFE6E9;
  --white: #FFFFFF;
  --shadow: 0 4px 15px rgba(74, 59, 64, 0.08);
  --shadow-hover: 0 6px 20px rgba(74, 59, 64, 0.12);
}

/* --- Reseteo Básico y Fuente --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background);
  color: var(--dark-text);
  line-height: 1.6;
}

/* --- Header y Búsqueda --- */
.app-header {
  padding: 2rem 5%;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-title {
  font-family: 'Times New Roman', Times, serif;
  font-weight: 400;
  font-size: 2.5rem;
  color: var(--luxury-pink);
  white-space: nowrap;
}

.brand-title span {
  font-style: italic;
  font-weight: 300;
  color: var(--dark-text);
}

.search-bar {
  flex-grow: 1;
  max-width: 400px;
  min-width: 250px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background-color: var(--background);
  color: var(--dark-text);
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--luxury-pink);
  box-shadow: 0 0 10px rgba(217, 169, 193, 0.3);
}

/* --- Grid de Productos --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Card de Producto --- */
.product-card {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.product-image-wrapper {
  width: 100%;
  padding-top: 100%; /* Aspect ratio 1:1 */
  position: relative;
  background-color: var(--border-color);
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 0.5rem;
  flex-grow: 1; /* Empuja el precio hacia abajo */
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--price-color);
  margin-top: 0.5rem;
}

/* --- Loader --- */
.loader {
  text-align: center;
  padding: 2rem;
  grid-column: 1 / -1; /* Ocupa todo el ancho del grid */
  font-size: 1.2rem;
  color: var(--luxury-pink);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(74, 59, 64, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.modal-content {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  opacity: 0;
  transform: scale(0.95);
  animation: zoomIn 0.3s 0.1s forwards;
}

.modal-image-container {
  width: 50%;
  flex-shrink: 0;
  background-color: var(--background);
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 500px; /* Asegura altura mínima */
}

.modal-details {
  width: 50%;
  padding: 2.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--dark-text);
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close-btn:hover {
  color: var(--price-color);
}

.modal-categories {
  font-size: 0.9rem;
  color: var(--luxury-pink);
  margin-bottom: 0.5rem;
}

.modal-product-name {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal-product-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--price-color);
  margin-bottom: 1.5rem;
}

.modal-description {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  flex-grow: 1; /* Ocupa espacio disponible */
}

.modal-meta {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 2rem;
}

.modal-meta span {
  display: block;
}

/* --- Botones de Pago --- */
.payment-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.payment-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 0.75rem;
}

.payment-btn img {
  height: 24px;
  width: auto;
}

/* Botón de WhatsApp (Verde) */
.btn-whatsapp {
  background-color: #25D366;
  color: var(--white);
}
.btn-whatsapp:hover {
  background-color: #1EAE50;
}

/* Botón de Zigi (Asumiendo un color, ajustar si es necesario) */
.btn-zigi {
  background-color: #f0f0f0; /* Color placeholder */
  color: #333;
  border: 1px solid #ccc;
}
.btn-zigi:hover {
  background-color: #e0e0e0;
}

/* Botón de BI (Color Azul de BI) */
.btn-bi {
  background-color: #004A99;
  color: var(--white);
}
.btn-bi:hover {
  background-color: #003366;
}


/* --- Animaciones --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* --- Responsividad --- */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-header {
    justify-content: center;
    text-align: center;
  }
  
  .brand-title {
    font-size: 2rem;
    width: 100%;
    margin-bottom: 1rem;
  }

  .search-bar {
    min-width: 100%;
  }

  .modal-content {
    flex-direction: column;
    width: 95%;
    max-height: 95vh;
  }

  .modal-image-container,
  .modal-details {
    width: 100%;
  }

  .modal-image {
    min-height: 300px; /* Reducir altura en móvil */
    max-height: 40vh;
  }
  
  .modal-details {
    padding: 2rem;
  }

  .modal-product-name {
    font-size: 1.5rem;
  }

  .modal-product-price {
    font-size: 1.3rem;
  }
}

@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
    padding: 2rem 5%;
    gap: 1.5rem;
  }
}