/**
 * Cart Feedback Modal & Floating Bar Styles
 * Clear, high-contrast, accessible for ages 45-70.
 */

/* Prevent scroll when modal is open */
body.villegas-modal-scroll-lock {
  overflow: hidden !important;
}

/* Modal Overlay */
.villegas-cart-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.villegas-cart-modal.is-active {
  display: block;
}

.villegas-cart-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(9, 9, 11, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: villegasFadeIn 0.2s ease-out;
}

@keyframes villegasFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes villegasSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dialog Container */
.villegas-cart-modal-dialog {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
  max-width: 480px;
  width: 100%;
  padding: 32px 28px;
  position: relative;
  font-family: var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
  animation: villegasSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

/* Close button */
.villegas-cart-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #F4F4F5;
  border: 1px solid #E4E4E7;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #52525B;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.villegas-cart-modal-close:hover {
  background: #18181B;
  color: #FFFFFF;
  border-color: #18181B;
}

/* Header with Success Badge */
.villegas-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-right: 30px;
}

.villegas-modal-check-badge {
  width: 42px;
  height: 42px;
  background-color: #ECFDF5;
  border: 2px solid #10B981;
  color: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.villegas-modal-header-title {
  margin: 0;
  font-family: var(--font-serif, "DM Serif Display", serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: #09090B;
  line-height: 1.2;
}

/* Book Summary Box */
.villegas-modal-book-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #FAF9F6;
  border: 1px solid #E4E4E7;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.villegas-modal-book-img {
  width: 64px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  background: #E4E4E7;
}

.villegas-modal-book-info {
  flex: 1;
  min-width: 0;
}

.villegas-modal-book-title {
  font-family: var(--font-serif, "DM Serif Display", serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #09090B;
  margin: 0 0 4px 0;
  line-height: 1.25;
}

.villegas-modal-book-author {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #71717A;
  font-weight: 600;
  margin-bottom: 6px;
}

.villegas-modal-book-price {
  font-family: var(--font-serif, "DM Serif Display", serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #8C7A46;
  margin: 0;
}

/* Next Step Instructional Callout */
.villegas-modal-next-step-box {
  background-color: #FEFCE8;
  border: 1px solid #FEF08A;
  border-left: 4px solid #EAB308;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.villegas-modal-next-step-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.villegas-modal-next-step-text {
  font-size: 13px;
  line-height: 1.45;
  color: #713F12;
  margin: 0;
}

.villegas-modal-next-step-text strong {
  color: #09090B;
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}

/* Action Buttons */
.villegas-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.villegas-modal-btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--villegas-gradient-crimson, linear-gradient(135deg, #8C7A46 0%, #5B4925 48%, #2B1C10 100%)) !important;
  color: #FFFFFF !important;
  text-decoration: none !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  padding: 15px 24px !important;
  border-radius: 6px !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(43, 28, 16, 0.3) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.villegas-modal-btn-checkout:hover {
  opacity: 0.93;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(43, 28, 16, 0.4) !important;
}

.villegas-modal-btn-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF !important;
  color: #52525B !important;
  border: 1px solid #D4D4D8 !important;
  border-radius: 6px !important;
  padding: 12px 20px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.villegas-modal-btn-continue:hover {
  background: #F4F4F5 !important;
  color: #09090B !important;
  border-color: #09090B !important;
}

.villegas-modal-cart-link-wrap {
  text-align: center;
  margin-top: 6px;
}

.villegas-modal-cart-link {
  font-size: 12px;
  color: #71717A;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.villegas-modal-cart-link:hover {
  color: #09090B;
}

/* ==========================================================================
   PERSISTENT FLOATING BOTTOM CART BAR
   ========================================================================== */
.villegas-floating-cart-bar {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99998;
  background-color: #111111;
  color: #FFFFFF;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 12px 18px;
  font-family: var(--font-sans, "Plus Jakarta Sans", system-ui, sans-serif);
  animation: villegasSlideUp 0.3s ease-out;
}

.villegas-floating-cart-bar.is-visible {
  display: flex;
  align-items: center;
  gap: 16px;
}

.villegas-floating-cart-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.villegas-floating-cart-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}

.villegas-floating-cart-text {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
}

.villegas-floating-cart-total {
  color: #E5D3B3;
  font-weight: 700;
}

.villegas-floating-cart-btn {
  background: var(--villegas-gradient-crimson, linear-gradient(135deg, #8C7A46 0%, #5B4925 48%, #2B1C10 100%)) !important;
  color: #FFFFFF !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-block;
}

.villegas-floating-cart-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .villegas-floating-cart-bar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    justify-content: space-between;
    padding: 12px 14px;
  }
}

/* Ocultar barra flotante de carrito permanentemente en Carrito y Finalizar Compra */
body.woocommerce-checkout #villegas-floating-cart-bar,
body.woocommerce-cart #villegas-floating-cart-bar,
body.page-id-22 #villegas-floating-cart-bar,
body.page-id-21 #villegas-floating-cart-bar,
.woocommerce-checkout .villegas-floating-cart-bar,
.woocommerce-cart .villegas-floating-cart-bar,
#villegas-checkout-page ~ #villegas-floating-cart-bar,
#villegas-cart-page ~ #villegas-floating-cart-bar,
#villegas-checkout-page ~ .villegas-floating-cart-bar,
#villegas-cart-page ~ .villegas-floating-cart-bar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
