/* ─────────────────────────────────────────────────────────
   LIBRO SHEET — "Quiero el libro completo" bottom sheet/modal
   ───────────────────────────────────────────────────────── */

/* ── Overlay ─────────────────────────────────────────────── */
#libro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#libro-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sheet base ──────────────────────────────────────────── */
#libro-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 301;
  background: #1A1008;
  border-radius: 24px 24px 0 0;
  padding: 12px 24px 32px;
  max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-overflow-scrolling: touch;
}

#libro-sheet.is-open {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  #libro-overlay { transition: none; }
  #libro-sheet   { transition: none; }
}

/* ── Desktop modal ───────────────────────────────────────── */
@media (min-width: 768px) {
  #libro-sheet {
    left: 50%;
    right: auto;
    bottom: 50%;
    transform: translate(-50%, 50%) scale(0.92);
    width: 100%;
    max-width: 480px;
    border-radius: 24px;
    max-height: 90vh;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
  }

  #libro-sheet.is-open {
    transform: translate(-50%, 50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  @media (prefers-reduced-motion: reduce) {
    #libro-sheet {
      transform: translate(-50%, 50%) scale(1);
      transition: none;
    }
  }
}

/* ── Handle bar ──────────────────────────────────────────── */
.libro-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(250, 243, 224, 0.25);
  margin: 0 auto 16px;
}

@media (min-width: 768px) {
  .libro-handle { display: none; }
}

/* ── Close button ────────────────────────────────────────── */
.libro-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(250, 243, 224, 0.6);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
}

.libro-close:hover,
.libro-close:focus-visible {
  color: #FAF3E0;
  background: rgba(250, 243, 224, 0.1);
  outline: none;
}

/* ── Book cover ──────────────────────────────────────────── */
.libro-cover {
  display: block;
  max-height: 120px;
  width: auto;
  margin: 8px auto 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
}

/* ── Header text ─────────────────────────────────────────── */
.libro-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: 24px;
  color: #FAF3E0;
  text-align: center;
  margin: 0 0 6px;
  line-height: 1.3;
}

.libro-subtitle {
  font-size: 15px;
  color: rgba(250, 243, 224, 0.55);
  text-align: center;
  margin: 0 0 20px;
  letter-spacing: 0.02em;
}

/* ── Store buttons ───────────────────────────────────────── */
.libro-stores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.libro-store-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: #2A1810;
  border: 1px solid #C9A84C;
  border-radius: 10px;
  color: #FAF3E0;
  font-family: 'Jost', sans-serif;
  font-size: 17px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-align: center;
}

.libro-store-btn:hover:not(:disabled) {
  background: rgba(201, 168, 76, 0.15);
}

.libro-store-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.libro-store-btn:focus-visible {
  outline: 2px solid #C9A84C;
  outline-offset: 2px;
}

.libro-store-btn--soon {
  opacity: 0.55;
  border-color: rgba(201, 168, 76, 0.4);
}

.libro-store-label {
  text-align: center;
}

.libro-store-soon {
  font-size: 12px;
  color: rgba(250, 243, 224, 0.4);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.libro-stores-loading {
  text-align: center;
  color: rgba(250, 243, 224, 0.4);
  font-size: 14px;
  padding: 16px 0;
}

/* ── Divider ─────────────────────────────────────────────── */
.libro-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
}

.libro-divider::before,
.libro-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(201, 168, 76, 0.35);
}

.libro-divider span {
  font-size: 13px;
  color: rgba(250, 243, 224, 0.45);
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1.4;
  flex-shrink: 0;
  max-width: 180px;
}

/* ── Email section ───────────────────────────────────────── */
.libro-email-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.libro-email-row {
  display: flex;
  gap: 8px;
}

.libro-email-input {
  flex: 1;
  padding: 12px 14px;
  background: #231409;
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 8px;
  color: #FAF3E0;
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  min-width: 0;
  transition: border-color 0.15s;
}

.libro-email-input::placeholder {
  color: rgba(250, 243, 224, 0.3);
}

.libro-email-input:focus {
  outline: none;
  border-color: #C9A84C;
}

.libro-email-btn {
  padding: 12px 16px;
  background: rgba(250, 243, 224, 0.08);
  border: 1px solid rgba(250, 243, 224, 0.25);
  border-radius: 8px;
  color: #FAF3E0;
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.libro-email-btn:hover:not(:disabled) {
  background: rgba(250, 243, 224, 0.14);
  border-color: rgba(250, 243, 224, 0.4);
}

.libro-email-btn:focus-visible {
  outline: 2px solid rgba(250, 243, 224, 0.5);
  outline-offset: 2px;
}

.libro-email-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.libro-email-error {
  font-size: 13px;
  color: #E07B6A;
  min-height: 16px;
  margin: 0;
}

.libro-email-success {
  font-size: 15px;
  color: rgba(250, 243, 224, 0.75);
  margin: 4px 0 0;
}

.libro-email-fine {
  font-size: 13px;
  color: rgba(250, 243, 224, 0.35);
  margin: 2px 0 0;
  letter-spacing: 0.01em;
}

/* ── Coming-soon → email nudge ───────────────────────────── */
@keyframes libro-pulse {
  0%   { border-color: rgba(201, 168, 76, 0.4); box-shadow: none; }
  40%  { border-color: #C9A84C; box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.3); }
  100% { border-color: rgba(201, 168, 76, 0.4); box-shadow: none; }
}

.libro-email-row.is-highlighted .libro-email-input {
  animation: libro-pulse 1.1s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .libro-email-row.is-highlighted .libro-email-input {
    animation: none;
    border-color: #C9A84C;
  }
}

/* ── Visually hidden (accessible label) ─────────────────── */
.libro-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
