/* Global variables for colors (kept in sync with tailwind.config in index.html) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

:root {
  --primary-pink: #FF69B4;
  --secondary-green: #3CB371;
  --accent-yellow: #FFD700;
  --background-light: #FFF0F5;
  --text-dark: #333333;
}

/* Base */
body {
  font-family: 'Inter', sans-serif;
  background-color: #f7f7f7; /* Fondo muy claro */
  color: var(--text-dark);
  line-height: 1.6;
}

/* Responsive container */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  transition: all 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

.mobile-menu.active {
  display: flex;
  max-height: 500px;
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 500px;
    opacity: 1;
  }
}

.mobile-menu.hidden {
  display: none;
}

/* Flower card hover/transition */
.flower-card {
  transition: all 0.3s ease-in-out;
  transform-origin: center;
}
.flower-card:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 15px -3px rgba(255, 105, 180, 0.3), 0 4px 6px -2px rgba(255, 105, 180, 0.15);
}

/* Navigation link styles (desktop) */
.nav-item {
  color: #4B5563; /* approximates Tailwind text-gray-600 */
  transition: color 0.3s ease, background-color 0.3s ease;
  padding: 0.5rem 0.75rem; /* px-3 py-2 */
  border-radius: 0.375rem; /* rounded-md */
  font-weight: 500; /* font-medium */
}
.nav-item:hover {
  color: var(--primary-pink);
}

/* Mobile nav items */
.mobile-nav-item {
  display: block;
  color: #374151; /* approximates Tailwind text-gray-700 */
  transition: color 0.3s ease, background-color 0.3s ease;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 1rem; /* text-base */
  font-weight: 500; /* font-medium */
}
.mobile-nav-item:hover {
  background-color: var(--background-light);
  color: var(--primary-pink);
}

/* Small helper: ensure focus outlines remain visible for accessibility */
:focus {
  outline: 2px solid rgba(0,0,0,0.08);
  outline-offset: 2px;
}

/* Utility color classes for flower pages */
.titulo-flor {
  color: var(--primary-pink);
}
.titulo-nombre-cientifico {
  color: var(--secondary-green);
}

/* Imagen circular para las flores: aro y sombra para distinguir del fondo */
.flor-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 105, 180, 0.12);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  background-color: #ffffff;
  display: inline-block;
}

.flor-image--sm {
  width: 80px;
  height: 80px;
}

/* Galería de flores con scroll horizontal */
.galeria-flor-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1rem;
  background-color: #ffffff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  scroll-behavior: smooth;
  /* Estilos para scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--primary-pink) #f0f0f0;
}

/* Responsive gallery spacing */
@media (max-width: 640px) {
  .galeria-flor-container {
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0.75rem;
  }
}

/* Scrollbar para navegadores webkit */
.galeria-flor-container::-webkit-scrollbar {
  height: 8px;
}

.galeria-flor-container::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

.galeria-flor-container::-webkit-scrollbar-thumb {
  background: var(--primary-pink);
  border-radius: 10px;
}

.galeria-flor-container::-webkit-scrollbar-thumb:hover {
  background: #ff1493;
}

.galeria-flor-item {
  flex: 0 0 220px;
  height: 220px;
  overflow: hidden;
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.15);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.galeria-flor-item:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 8px 20px rgba(255, 105, 180, 0.25);
}

.galeria-flor-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.galeria-flor-item:hover .galeria-flor-img {
  transform: scale(1.1);
}

/* Modal de zoom */
.galeria-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.galeria-modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.galeria-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.galeria-modal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.galeria-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
  background: rgba(0, 0, 0, 0.6);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-align: center;
  line-height: 1;
}

.galeria-modal-close:hover {
  color: var(--primary-pink);
  background: rgba(0, 0, 0, 0.9);
}

.galeria-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  padding: 10px 20px;
  user-select: none;
  transition: color 0.3s ease;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
}

.galeria-modal-nav:hover {
  color: var(--primary-pink);
  background: rgba(0, 0, 0, 0.8);
}

.galeria-modal-prev {
  left: 20px;
}

.galeria-modal-next {
  right: 20px;
}

.galeria-modal-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
}

/* RESPONSIVE DESIGN */

/* Tablets (640px - 1024px) */
@media (max-width: 1024px) {
  .flower-card {
    padding: 1rem;
  }

  .flor-image {
    width: 100px;
    height: 100px;
  }

  .galeria-flor-item {
    flex: 0 0 180px;
    height: 180px;
  }

  .galeria-modal-nav {
    font-size: 24px;
  }

  .galeria-modal-close {
    font-size: 32px;
    top: 15px;
    right: 20px;
  }
}

/* Small Devices (640px and below) */
@media (max-width: 640px) {
  .flower-card {
    padding: 0.75rem;
  }

  .flor-image {
    width: 80px;
    height: 80px;
  }

  .flor-image--sm {
    width: 60px;
    height: 60px;
  }

  .galeria-flor-item {
    flex: 0 0 150px;
    height: 150px;
  }

  .galeria-modal-nav {
    font-size: 20px;
    padding: 8px 15px;
  }

  .galeria-modal-prev {
    left: 10px;
  }

  .galeria-modal-next {
    right: 10px;
  }

  .galeria-modal-close {
    font-size: 28px;
    top: 10px;
    right: 15px;
  }

  .galeria-modal-counter {
    font-size: 12px;
    bottom: 15px;
    padding: 6px 12px;
  }

  /* Text scaling for small screens */
  h1 {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  h3 {
    font-size: 1.1rem !important;
  }

  h4 {
    font-size: 1rem !important;
  }

  p {
    font-size: 0.95rem;
  }

  .titulo-flor {
    font-size: 1.25rem;
  }

  .titulo-nombre-cientifico {
    font-size: 0.95rem;
  }

  /* Flower detail view responsive */
  .flower-detail {
    padding: 1rem;
  }

  .prose {
    font-size: 0.95rem;
  }

  /* Button and link adjustments */
  button, a {
    padding: 0.5rem 1rem;
  }

  .mobile-nav-item {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
}

/* Extra small devices (360px and below) */
@media (max-width: 360px) {
  h1 {
    font-size: 1.25rem !important;
  }

  h2 {
    font-size: 1.1rem !important;
  }

  h3 {
    font-size: 1rem !important;
  }

  p {
    font-size: 0.9rem;
  }

  .titulo-flor {
    font-size: 1.1rem;
  }

  .flor-image {
    width: 70px;
    height: 70px;
  }

  .galeria-flor-item {
    flex: 0 0 130px;
    height: 130px;
  }
}

/* Fix para que los botones de contacto no cambien de color al ser visitados */
#contact-email:visited {
  background-color: var(--secondary-green) !important;
  color: white !important;
}
#contact-whatsapp:visited {
  background-color: #25D366 !important;
  color: white !important;
}
#contact-phone:visited {
  background-color: var(--primary-pink) !important;
  color: white !important;
}