/*
Theme Name: Buscando a Memo
Theme URI: https://github.com/pachidj87/wp-bam-theme
Author: Buscando a Memo Team
Description: Landing page theme for Buscando a Memo — the book about comedy and charisma.
Version: 2.2.42
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: buscandoamemo
Tags: full-site-editing, block-patterns, e-commerce, woocommerce
*/

:root {
  --memo-orange: #F7931E;
  --memo-gold: #FFB21C;
  --memo-deep-orange: #E85D04;
  --ocean-blue: #087EA4;
  --deep-ocean: #063B63;
  --midnight-ocean: #061B35;
  --cyan: #16C6E8;
  --cream: #FFF1D6;
  --show-red: #FF3030;

  /* Text-ink variants.
   *
   * --ocean-blue and --memo-orange are BRAND colors: bright, and correct for
   * borders, bullets, backgrounds and dark surfaces. They are NOT safe as text
   * on a light background. Measured against WCAG 2.x:
   *
   *   --ocean-blue  #087EA4 on --cream #FFF1D6 = 4.15  (fails 4.5)
   *   --memo-orange #F7931E on cream-ish        = 1.97  (fails badly)
   *
   * These two deeper variants are the same hues, shaded until they pass on
   * light surfaces. Use them for TEXT on cream/white; keep the bright originals
   * for everything else. Do not swap one for the other globally -- the bright
   * versions are also used on dark ocean backgrounds, where darkening them
   * would break those instead.
   *
   *   --ocean-blue-ink #066C86 on --cream        = 5.38
   *   --orange-ink     #A84203 on cream-ish       = 5.22
   */
  --ocean-blue-ink: #066C86;
  --orange-ink: #A84203;
  --dark: #171313;
}

:where(.wp-site-blocks) > * {
  margin-block-start: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lilita One', cursive;
}

/* =========================================================================
   MINI-CART (block) — sitewide
   Drawer appears on every page (header trigger), so these styles live in
   style.css, not woocommerce.css. Same BAM voice: --memo-* palette,
   10px radii, orange primary buttons with orange glow, cyan focus rings.
   ========================================================================= */

/* Trigger — cart button in the fixed header */
.bam-header__nav .wc-block-mini-cart {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
}

.bam-header__nav .wc-block-mini-cart__button {
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 10px;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}

.bam-header__nav .wc-block-mini-cart__button:hover {
  background: rgba(6, 59, 99, 0.08);
}

.bam-header__nav .wc-block-mini-cart__button .wc-block-mini-cart__icon {
  color: var(--memo-orange);
  height: 1.5em;
  width: 1.5em;
}

.bam-header__nav .wc-block-mini-cart__button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.bam-header__nav .wc-block-mini-cart__badge {
  background: var(--memo-orange) !important;
  color: #fff !important;
  font-weight: 800;
  border: 2px solid #fff !important;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(23, 19, 19, 0.25);
}

.bam-header__nav .wc-block-mini-cart__quantity-badge {
  color: #fff;
}

.bam-header__nav .wc-block-mini-cart__quantity-badge .wc-block-mini-cart__badge,
.bam-header__nav .wc-block-mini-cart__quantity-badge .wc-block-mini-cart__badge:hover {
  color: #fff;
}

/* Drawer panel */
.wc-block-mini-cart__drawer.wc-block-components-drawer,
.wc-block-mini-cart__drawer {
  width: min(420px, 100vw);
  max-width: 100vw;
  background: linear-gradient(180deg, var(--cream) 0%, #fff 32%);
  border-left: none;
  box-shadow: -12px 0 40px rgba(6, 27, 53, 0.28);
  z-index: 2000;
  transition: transform 0.3s ease;
}

.wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-contents {
  background: transparent;
}

/* Drawer title */
.wc-block-mini-cart__title {
  font-family: 'Lilita One', cursive;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: var(--deep-ocean);
}

/* Products table + rows */
.wc-block-mini-cart__products-table {
  border-collapse: collapse;
}

.wc-block-mini-cart__products-table .wc-block-cart-item__image {
  border-collapse: collapse;
}

.wc-block-mini-cart__products-table .wc-block-cart-items__row,
.wc-block-mini-cart__item {
  border-bottom: 1px solid rgba(6, 27, 53, 0.1);
}

.wc-block-mini-cart__products-table .wc-block-cart-items__row:last-child,
.wc-block-mini-cart__item:last-child {
  border-bottom: none;
}

.wc-block-mini-cart__drawer .wc-block-components-product-name {
  font-size: 1.0rem !important;
  line-height: 1.4;
  font-weight: 800;
  color: var(--dark);
}

.wc-block-mini-cart__drawer .wc-block-components-product-price,
.wc-block-mini-cart__drawer .wc-block-components-product-prices {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--memo-deep-orange);
}

/* Product info block — larger image, name, price and details in the drawer */
.wc-block-mini-cart__drawer .wc-block-cart-item__image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

.wc-block-mini-cart__drawer .wc-block-cart-item__product {
  font-size: 1rem;
}

.wc-block-mini-cart__drawer .wc-block-components-product-metadata,
.wc-block-mini-cart__drawer .wc-block-components-product-details {
  font-size: 0.95rem !important;
  color: rgba(23, 19, 19, 0.75);
  margin-bottom: 9px;
}

/* Quantity selector in the drawer */
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector {
  border: 2px solid var(--ocean-blue);
  border-radius: 8px;
}

.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__button:hover {
  background: rgba(8, 126, 164, 0.1);
}

/* Remove item */
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link,
.wc-block-mini-cart__drawer .wc-block-components-product-remove {
  color: var(--show-red);
  font-weight: 700;
  text-decoration: none;
}

.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link:hover,
.wc-block-mini-cart__drawer .wc-block-components-product-remove:hover {
  color: var(--show-red);
  opacity: 0.8;
}

.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link:focus-visible,
.wc-block-mini-cart__drawer .wc-block-components-product-remove:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* Footer + subtotal */
.wc-block-mini-cart__footer {
  background: #fff;
  border-top: 1px solid rgba(6, 27, 53, 0.1);
}

.wc-block-mini-cart__footer .wc-block-mini-cart__subtotal,
.wc-block-mini-cart__footer .wc-block-mini-cart__footer-subtotal,
.wc-block-mini-cart__footer .wc-block-components-totals-item {
  font-weight: 800;
  color: var(--deep-ocean);
}

.wc-block-mini-cart__footer .wc-block-components-totals-item__value,
.wc-block-mini-cart__drawer .wc-block-mini-cart__amount {
  font-weight: 800;
  color: var(--memo-orange);
}

/* Footer buttons — full BAM primary style, stacked */
.wc-block-mini-cart__footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wc-block-mini-cart__footer-actions .wc-block-components-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  background: var(--memo-orange);
  border: none;
  border-radius: 10px;
  padding: 14px 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(247, 147, 30, 0.28);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wc-block-mini-cart__footer-actions .wc-block-components-button:hover {
  background: var(--memo-deep-orange);
  transform: translateY(-1px);
}

.wc-block-mini-cart__footer-actions .wc-block-components-button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* "View cart" button — ocean outline with wider border (3px) */
.wc-block-mini-cart-cart-button-block .wc-block-components-button,
.wp-block-woocommerce-mini-cart-cart-button-block .wc-block-components-button {
  background: transparent;
  color: var(--ocean-blue);
  border: 3px solid var(--ocean-blue);
  box-shadow: none;
}

.wc-block-mini-cart-cart-button-block .wc-block-components-button:hover,
.wp-block-woocommerce-mini-cart-cart-button-block .wc-block-components-button:hover {
  background: var(--ocean-blue);
  color: #fff;
}

/* Empty cart state */
.wc-block-mini-cart__empty-cart-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}

.wc-block-mini-cart__empty-cart-title {
  font-family: 'Lilita One', cursive;
  color: var(--deep-ocean);
}

.wc-block-mini-cart__shopping-button {
  margin-top: 12px;
}

.wc-block-mini-cart__shopping-button a {
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  background: var(--memo-orange);
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(247, 147, 30, 0.28);
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.wc-block-mini-cart__shopping-button a:hover {
  background: var(--memo-deep-orange);
  transform: translateY(-1px);
}

.wc-block-mini-cart__shopping-button a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* Responsive — drawer fills the viewport, actions stack below 768px */
@media (max-width: 768px) {
  .wc-block-mini-cart__drawer.wc-block-components-drawer,
  .wc-block-mini-cart__drawer {
    width: 100%;
  }

  .wc-block-mini-cart__footer-actions {
    flex-direction: column;
  }
}

/* Reduced motion — disable drawer/button transitions */
@media (prefers-reduced-motion: reduce) {
  .wc-block-mini-cart__drawer.wc-block-components-drawer,
  .wc-block-mini-cart__drawer,
  .bam-header__nav .wc-block-mini-cart__button,
  .wc-block-mini-cart__footer-actions .wc-block-components-button,
  .wc-block-mini-cart__shopping-button a {
    transition: none;
    transform: none;
  }
}

@container (min-width: 700px) {
  .wc-block-checkout__sidebar {
    top: 88px;
  }
}
