/* Renhel Flipbook Styles (Adapted from catalogo-inicial.html) */

:root {
  --renhel-primary: #2E8B57;
  /* SeaGreen - Farmacia */
  --renhel-secondary: #20B2AA;
  /* LightSeaGreen */
  --renhel-accent: #FF69B4;
  /* HotPink - Perfumería */
  --renhel-gold: #DAA520;
  --renhel-text: #333;
  --renhel-bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --renhel-card-bg: white;
}

#renhel-flipbook-app {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  width: 100%;
  min-height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: var(--renhel-bg-gradient);
  position: relative;
}

#renhel-flipbook-app .book-container {
  perspective: 2500px;
  position: relative;
  z-index: 1;
}

#renhel-flipbook-app .book {
  position: relative;
  width: 800px;
  height: 550px;
  min-width: 800px;
  /* Force size for flip effect */
  transform-style: preserve-3d;
}

/* Responsive adjustment for WP Context */
@media (max-width: 850px) {
  #renhel-flipbook-app .book {
    width: 100%;
    min-width: 320px;
    height: auto;
    min-height: 500px;
    display: flex;
    flex-direction: column;
  }

  #renhel-flipbook-app .page {
    position: relative !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    transform: none !important;
    margin-bottom: 20px;
    backface-visibility: visible !important;
  }

  #renhel-flipbook-app .page-back-content {
    transform: none !important;
    position: relative !important;
  }
}

#renhel-flipbook-app .page {
  position: absolute;
  width: 400px;
  height: 550px;
  right: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  cursor: pointer;
}

#renhel-flipbook-app .page-content {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-color: white;
}

#renhel-flipbook-app .page-front-content {
  border-radius: 0 5px 5px 0;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.05) 0%, rgba(255, 255, 255, 1) 5%, #ffffff 100%);
  z-index: 2;
  backface-visibility: hidden;
}

#renhel-flipbook-app .page-back-content {
  border-radius: 5px 0 0 5px;
  background-image: linear-gradient(to left, rgba(0, 0, 0, 0.05) 0%, rgba(255, 255, 255, 1) 5%, #ffffff 100%);
  transform: rotateY(180deg);
  z-index: 1;
  backface-visibility: hidden;
}

#renhel-flipbook-app .page.flipped {
  transform: rotateY(-180deg);
}

/* Typography */
#renhel-flipbook-app h2 {
  font-size: 1.4rem;
  color: var(--renhel-primary);
  margin: 10px 15px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--renhel-secondary);
  padding-bottom: 5px;
}

/* Grid */
#renhel-flipbook-app .product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  flex-grow: 1;
}

#renhel-flipbook-app .product-card {
  background: var(--renhel-card-bg);
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.3s;
}

#renhel-flipbook-app .product-img {
  width: 80px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 5px;
}

#renhel-flipbook-app .product-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 3px;
  color: #333;
  line-height: 1.2;
}

#renhel-flipbook-app .product-status-msg {
  font-size: 0.7rem;
  color: #d9534f;
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

#renhel-flipbook-app .status-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.6rem;
  padding: 2px 5px;
  border-radius: 4px;
  color: white;
}

#renhel-flipbook-app .status-available {
  background: var(--renhel-primary);
}

#renhel-flipbook-app .status-unavailable {
  background: #d9534f;
}

/* Contact Form Overlay */
.rh-fb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
}

.rh-fb-modal {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  position: relative;
}

.rh-fb-modal h3 {
  margin-top: 0;
  color: var(--renhel-primary);
}

.rh-fb-close {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

/* Floating Action Button */
.rh-fb-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--renhel-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 9999;
}