/* ==========================================================================
   Design System Patterns — Tienda Mágica
   Feature: 003-gutenberg-patterns
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section backgrounds (map to tokens — no hardcoded colors)
   -------------------------------------------------------------------------- */

.magica-bg-white {
    background: var(--color-bg);
}

.magica-bg-surface {
    background: var(--color-surface);
}

.magica-bg-surface-2 {
    background: var(--color-surface-2);
}

.magica-bg-primary {
    background: var(--color-primary);
}

.magica-bg-primary-gradient {
    background: linear-gradient(
        135deg,
        var(--color-primary) 0%,
        var(--color-primary-dark) 60%,
        var(--color-dark) 100%
    );
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.magica-section {
    padding: var(--space-xl) var(--space-sm);
    border-top: 1px solid var(--color-border);
}

/* First section (trust-bar) has no border-top — it's the visual start */
.magica-trust-bar-section {
    border-top: none;
}

.magica-section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Grids — mobile-first
   -------------------------------------------------------------------------- */

.magica-grid-4,
.magica-grid-3,
.magica-grid-2 {
    display: grid;
    gap: var(--space-md);
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .magica-grid-4,
    .magica-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .magica-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .magica-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .magica-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .magica-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Card component
   -------------------------------------------------------------------------- */

.magica-product-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--color-bg);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.magica-product-card:hover,
.magica-product-card:focus-within {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
}

/* ── Product card sub-components (extracted from inline styles) ── */
.magica-product-card__media {
    position: relative;
}

.magica-product-card__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.magica-product-card__body {
    padding: var(--space-sm);
}

.magica-product-card__name {
    font-size: 0.9375rem;
    margin: 0 0 6px;
    line-height: 1.3;
}

.magica-product-card__link {
    text-decoration: none;
    color: var(--color-text);
}

.magica-product-card__price {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.magica-product-card__cta {
    font-size: 0.8125rem;
    padding: 8px 16px;
}

/* --------------------------------------------------------------------------
   Category card — gradient bg + arrow hover
   -------------------------------------------------------------------------- */

.magica-category-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    min-height: 240px;
    cursor: pointer;
}

.magica-category-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.magica-category-bg-gradient {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
}

.magica-category-dark-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.08) 0%, rgba(30, 27, 75, 0.75) 100%);
}

.magica-category-arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-light);
    font-size: 1.1rem;
    transition: background 150ms ease;
    z-index: 1;
}

.magica-category-card:hover .magica-category-arrow {
    background: var(--color-cta);
}

.magica-category-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    z-index: 1;
}

.magica-category-card__title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-light);
    margin-bottom: 4px;
}

.magica-category-card__count {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ── Section header — tag + h2 + description ── */
.magica-section-header {
    text-align: center;
    margin-bottom: 48px;
}

.magica-section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--color-text);
    margin: 12px 0 10px;
}

.magica-section-header p {
    color: var(--color-text-muted);
    max-width: 520px;
    margin: 0 auto;
}


/* --------------------------------------------------------------------------
   Badge components
   -------------------------------------------------------------------------- */

.magica-badge {
    display: inline-block;
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.magica-badge-primary {
    background: var(--color-primary);
    color: var(--color-light);
}

/* Product card badge — absolute top-left over image */
.magica-product-card__badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 1;
}

/* "Nuevo" badge — top-right */
.magica-product-card__badge--new {
    bottom: auto;
    top: 12px;
    left: auto;
    right: 12px;
}

.magica-badge-accent {
    /* WCAG AA fix: accent pink (#EC4899) + white = 3.59:1 (fails 4.5:1).
       Use outlined style — accent as border only, dark text on near-white bg. */
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 2px solid var(--color-accent);
}

/* --------------------------------------------------------------------------
   Promo banner card
   -------------------------------------------------------------------------- */

.magica-promo-banner {
    background: linear-gradient(135deg, var(--color-surface-2), #FEF3C7);
    border: 2px solid rgba(249, 115, 22, 0.2);
    border-radius: 28px;
    padding: var(--space-xl) 48px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-lg);
    align-items: center;
}

@media (max-width: 768px) {
    .magica-promo-banner {
        grid-template-columns: 1fr;
        padding: 40px 24px;
        text-align: center;
    }

    .magica-promo-banner__desc {
        max-width: 100%;
    }
}

.magica-promo-banner__tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-cta-dark);
    background: rgba(249, 115, 22, 0.12);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 14px;
}

.magica-promo-banner__title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 10px;
}

.magica-promo-banner__desc {
    color: var(--color-text-muted);
    max-width: 420px;
    margin-bottom: 28px;
}

.magica-promo-banner__timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    align-self: stretch;
}

.magica-promo-banner__timer .magica-countdown {
    justify-content: center;
}

.magica-promo-timer-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    display: inline-block;
    animation: promo-label-pulse 1.6s ease-in-out infinite;
}

@keyframes promo-label-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(2); }
}

/* --------------------------------------------------------------------------
   Countdown component
   -------------------------------------------------------------------------- */

.magica-countdown {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    align-items: center;
}

.magica-countdown-digit {
    background: var(--color-primary);
    color: var(--color-light);
    border-radius: 8px;
    padding: 8px 14px;
    text-align: center;
    min-width: 64px;
}

.magica-countdown--cta .magica-countdown-digit {
    background: var(--color-cta);
    border-radius: 12px;
    padding: 12px 16px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.magica-countdown__value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.magica-countdown__label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
    opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Blog card component
   -------------------------------------------------------------------------- */

.magica-blog-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.magica-blog-card__title {
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

.magica-blog-card__link {
    text-decoration: none;
    color: var(--color-text);
}

.magica-blog-card:hover,
.magica-blog-card:focus-within {
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.12);
    transform: translateY(-2px);
}

.magica-blog-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.magica-blog-card__body {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.magica-blog-card__excerpt {
    color: var(--color-text-muted, #6B7280);
    font-size: 0.9375rem;
    line-height: 1.6;
    flex: 1;
}

/* --------------------------------------------------------------------------
   Stat item
   -------------------------------------------------------------------------- */

.magica-stat-item {
    text-align: center;
    padding: var(--space-md);
    color: var(--color-light);
    border-right: 1px solid rgba(255, 255, 255, 0.25);
}

.magica-stat-item:last-child {
    border-right: none;
}

.magica-stat-item__value {
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.magica-stat-item__label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.85;
}

/* Stats bar grid — 4 columns desktop, 2×2 on mobile */
.magica-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .magica-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .magica-stat-item {
        border-right: none;
    }

    .magica-stat-item:nth-child(odd) {
        border-right: 1px solid rgba(255, 255, 255, 0.25);
    }

    .magica-stat-item:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

/* --------------------------------------------------------------------------
   Hero v2 — Feature 008 (mockup visual parity)
   50/50 split layout | blobs | glassmorphism card | floating chips
   All values via var(--token). No hardcoded colors outside :root.
   -------------------------------------------------------------------------- */

/* ── Base: gradient bg + SVG circle trama ── */
.magica-hero {
    padding: 100px 24px;
    position: relative;
    overflow: visible;
    color: var(--color-light);
}

.magica-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* ── Blobs decorativos ── */
.magica-hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
    pointer-events: none;
}

.magica-hero-blob-1 {
    width: 400px;
    height: 400px;
    background: var(--color-accent);
    top: -100px;
    right: -80px;
}

.magica-hero-blob-2 {
    width: 300px;
    height: 300px;
    background: var(--color-cta);
    bottom: -80px;
    left: 10%;
}

/* ── Inner grid 50/50 ── */
.magica-hero-inner {
    position: relative;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
    overflow: visible;
}

/* ── Eyebrow: CTA-colored line + uppercase text ── */
.magica-hero-eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.magica-hero-eyebrow-line {
    display: inline-block;
    width: 24px;
    height: 2px;
    background: var(--color-cta);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ── Heading with golden em ── */
.magica-hero-heading {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    color: var(--color-light);
}

.magica-hero-em {
    font-style: normal;
    color: var(--color-gold);
}

/* ── Description ── */
.magica-hero__description {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.82);
    max-width: 460px;
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

/* ── CTA row: naranja + ghost blanco ── */
.magica-hero__actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.magica-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-light);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
}

.magica-hero-cta:hover {
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.45);
    color: var(--color-light);
}

.magica-hero-ghost {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.85rem 1.7rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.93rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: background 150ms ease, transform 150ms ease;
}

.magica-hero-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    color: rgba(255, 255, 255, 0.9);
}

/* ── Trust indicator: estrellas + texto ── */
.magica-hero-trust {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
}

.magica-hero-stars {
    display: flex;
    gap: 2px;
}

/* ── Right column: image area ── */
.magica-hero-image {
    position: relative;
    overflow: visible;
}

/* ── Glassmorphism card ── */
.magica-hero-card-main {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 24px;
}

.magica-hero-product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    margin-bottom: var(--space-sm);
}

.magica-hero-product-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-light);
    margin-bottom: -8px;
    text-align: center;
}

.magica-hero-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.magica-hero-product-price {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--color-gold);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.magica-hero-product-old {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
}

.magica-hero-card-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.82rem;
    color: var(--color-light);
}

/* ── Floating chips ── */
.magica-hero-floating {
    position: absolute;
    background: var(--color-light);
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    z-index: 2;
}

.magica-hero-floating-1 {
    top: -16px;
    right: -60px;
}

.magica-hero-floating-2 {
    bottom: -16px;
    left: -60px;
}

@keyframes magica-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.magica-hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    margin-right: 8px;
    animation: magica-pulse 2s ease-in-out infinite;
}

.magica-hero-dot--success { background: var(--color-success); }
.magica-hero-dot--cta     { background: var(--color-cta); }

/* ── Mobile: stack columna única ── */
@media (max-width: 767px) {
    .magica-hero {
        padding: var(--space-xl) var(--space-sm);
    }

    .magica-hero-inner {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        text-align: center;
    }

    .magica-hero__actions {
        justify-content: center;
    }

    .magica-hero-trust {
        justify-content: center;
    }

    .magica-hero__description {
        margin-left: auto;
        margin-right: auto;
    }

    .magica-hero-image {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .magica-hero-floating-1,
    .magica-hero-floating-2 {
        position: absolute;
        display: block;
        padding: 8px 14px;
        font-size: 0.8rem;
        width: fit-content;
        z-index: 10;
    }

    .magica-hero-floating-1 {
        top: -16px;
        right: -60px;
    }

    .magica-hero-floating-2 {
        position: absolute;
        bottom: -16px;
        left: -60px;
    }

    .magica-hero-card-main {
        position: relative;
        z-index: 1;
    }
}

/* --------------------------------------------------------------------------
   Accessibility utilities
   -------------------------------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Trust bar component (T002 — FR-010)
   -------------------------------------------------------------------------- */

.magica-trust-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    list-style: none;
    margin: 0;
    padding: 0;
}

.magica-trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1 1 200px;
    max-width: 280px;
}

.magica-trust-icon {
    flex-shrink: 0;
    color: var(--color-success-dark, #047857);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.magica-trust-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.magica-trust-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--color-text);
    line-height: 1.3;
}

.magica-trust-description {
    font-size: 0.8125rem;
    color: var(--color-text); /* WCAG AA: --color-text-muted (#64748B) fails 4.5:1 on surface-2 */
    line-height: 1.4;
}

@media (max-width: 479px) {
    .magica-trust-item {
        flex: 1 1 calc(50% - var(--space-md));
        max-width: none;
    }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .magica-product-card,
    .magica-blog-card {
        transition: none;
    }

    .magica-product-card:hover,
    .magica-product-card:focus-within,
    .magica-blog-card:hover,
    .magica-blog-card:focus-within {
        transform: none;
    }
}

/* (Feature 006 old block nav styles removed — homepage uses custom #magica-nav) */

/* ============================================================
   T015 / FR-010, FR-012: Payment badges — footer section
   WCAG AA: rgba(255,255,255,0.85) on #1E1B4B ≈ 8.1:1 ✅
   ============================================================ */
.magica-payment-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

.magica-payment-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}

/* T015 / FR-013: Footer base styling via tokens */
footer,
.wp-block-template-part footer {
  background: var(--color-dark) !important;
  color: rgba(255,255,255,0.75);
}

footer a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 150ms ease;
}

footer a:hover {
  color: var(--color-light);
}

/* ==========================================================================
   Feature 008 — Nav, Trust Bar Compact, Stats Bar, Footer matching mockup
   ========================================================================== */

/* ── NAV ──────────────────────────────────────────────────────────────────── */
#magica-sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-bar #magica-sticky-header { top: 32px; }
@media (max-width: 782px) { .admin-bar #magica-sticky-header { top: 46px; } }

#magica-nav {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 20px rgba(109, 40, 217, 0.12), 0 1px 4px rgba(109, 40, 217, 0.08);
}

.magica-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.magica-nav-logo {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.magica-nav-logo svg { width: 28px; height: 28px; }
.magica-nav-logo__img { height: 36px !important; max-height: 36px; width: auto !important; display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.15)); }

/* Prevent any overflow from the logo area */
#magica-nav { overflow: hidden; }

.magica-nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.magica-nav-links a {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    opacity: 0.75;
    transition: opacity 150ms, color 150ms;
}

.magica-nav-links a:hover,
.magica-nav-links a.active {
    opacity: 1;
    color: var(--color-primary);
}

.magica-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.magica-nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    text-decoration: none;
    transition: background 150ms;
    position: relative;
}

.magica-nav-icon:hover { background: var(--color-border); }

.magica-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-cta);
    color: var(--color-light);
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile: hamburger visible, nav links ocultos */
.magica-hamburger { display: none; }

@media (max-width: 767px) {
    .magica-nav-links { display: none; }
    .magica-hamburger { display: flex; }

    /* Reorder: hamburger(1) | logo(2) | nav-links hidden(3) | actions(4) */
    .magica-hamburger   { order: 1; }
    #magica-nav .magica-nav-logo    { order: 2; flex: 1; justify-content: center; }
    .magica-nav-links   { order: 3; }
    .magica-nav-actions { order: 4; }
}

/* Mobile drawer */
/* ── Off-canvas overlay ── */
#magica-mobile-overlay {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 98;
    transition: opacity 300ms ease;
    opacity: 0;
}

/* ── Floating menu drawer ── */
#magica-mobile-menu {
    position: fixed;
    top: var(--nav-height);
    left: 16px;
    right: 16px;
    height: auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(109, 40, 217, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 300ms ease, opacity 300ms ease;
    overflow: hidden;
    margin-top: 10px;
}

@media (max-width: 767px) {
    #magica-mobile-overlay.is-open {
        display: block;
        opacity: 1;
    }
    #magica-mobile-menu.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
}

/* Header del drawer */
.magica-mobile-menu-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.magica-mobile-menu-logo {
    height: 36px;
    width: auto;
}

.magica-mobile-menu-brand {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Links */
#magica-mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: var(--space-xs) 0;
}

#magica-mobile-menu li a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px var(--space-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin: 2px var(--space-sm);
    transition: background 150ms, color 150ms;
}

#magica-mobile-menu li a svg {
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 150ms;
}

#magica-mobile-menu li a:hover,
#magica-mobile-menu li a.active {
    background: var(--color-surface);
    color: var(--color-primary);
}

#magica-mobile-menu li a:hover svg,
#magica-mobile-menu li a.active svg {
    opacity: 1;
}

/* ── TRUST BAR COMPACT — scrolling ticker ─────────────────────────────────── */
.magica-trust-bar-compact {
    padding: 4px 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    overflow: hidden;
}

.magica-trust-ticker {
    overflow: hidden;
    white-space: nowrap;
}

.magica-trust-ticker__track {
    display: inline-flex;
    gap: 64px;
    animation: trust-ticker 20s linear infinite;
    white-space: nowrap;
}

.magica-trust-ticker__track:hover {
    animation-play-state: paused;
}

@keyframes trust-ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.magica-trust-compact-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    flex-shrink: 0;
}

.magica-trust-compact-item svg {
    color: var(--color-primary);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

@media (prefers-reduced-motion: reduce) {
    .magica-trust-ticker__track {
        animation: none;
    }
}

/* ── STATS BAR compact padding ──────────────────────────────────────────── */
.magica-stats-bar {
    padding: 20px 0;
}

.magica-stats-bar .magica-section-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.magica-stats-bar .magica-stats-grid {
    display: flex;
    justify-content: center;
    gap: 64px;
}

.magica-stats-bar .magica-stat-item {
    border-right: none;
    padding: 0;
}

.magica-stats-bar .magica-stat-item__label {
    font-size: 0.78rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .magica-stats-bar .magica-stats-grid {
        gap: 24px;
        flex-wrap: wrap;
    }

    .magica-stats-bar .magica-stat-item__label {
        white-space: normal;
    }
}

/* ── FINAL CTA SECTION ───────────────────────────────────────────────────── */
.magica-cta-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 80px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.magica-cta-section::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    top: -200px;
    left: -100px;
    pointer-events: none;
}

.magica-cta-section .magica-section-inner {
    position: relative;
}

.magica-cta-section h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--color-light);
    margin-bottom: 14px;
}

.magica-cta-section p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 480px;
    margin: 0 auto 32px;
    font-size: 1rem;
}

.magica-cta-section__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.magica-cta-section .btn-ghost {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
}

.magica-cta-section .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--color-light);
    border-color: rgba(255, 255, 255, 0.7);
}

/* ── FOOTER 4 COLUMNS ─────────────────────────────────────────────────────── */
#magica-footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.75);
    padding: 48px 0 24px;
}

.magica-footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.magica-footer-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.magica-footer-logo {
    color: var(--color-light);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.magica-footer-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
    gap: 16px;
}

.magica-footer-brand__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.magica-footer-brand p {
    font-size: 0.85rem;
    line-height: 1.7;
    max-width: 200px;
    margin: 0;
}

.magica-footer-brand__mascot {
    width: auto;
    height: 100%;
    max-height: 140px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    align-self: center;
}

/* Right column: nav + social side by side */
.magica-footer-right {
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: center;
    justify-content: flex-end;
}

/* Social media column */
.magica-footer-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
}

.magica-footer-social h4 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px;
}

.magica-footer-social__icons {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

.magica-footer-social__icons a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 150ms, transform 150ms;
    display: flex;
}

.magica-footer-social__icons a:hover {
    color: var(--color-light);
    transform: scale(1.15);
}

/* Footer nav: titles stacked, each col is the anchor for its floating panel */
.magica-footer-col-nav {
    display: flex;
    flex-direction: column;
    align-self: center;
    justify-content: center;
}

.magica-footer-col {
    position: static;
}

.magica-footer-col-nav h4 {
    position: relative;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-light);
    margin: 0 0 14px;
    text-transform: uppercase;
}

.magica-footer-col:last-child h4 {
    margin-bottom: 0;
}

.magica-footer-col-nav h4 {
    letter-spacing: 0.08em;
}

/* Toggle button — fixed width to align ≡ icons vertically */
.magica-footer-col__toggle {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 120px;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: rgba(255,255,255,0.55);
    letter-spacing: inherit;
    text-transform: inherit;
    transition: color 150ms;
}

.magica-footer-col__toggle[aria-expanded="true"] {
    color: var(--color-light);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Panel: absolutely positioned floating card, no layout space taken */
.magica-footer-panel {
    position: fixed;
    z-index: 9999;
    list-style: none;
    padding: 16px;
    margin: 0;
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(22, 20, 60, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
}

.magica-footer-panel.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.magica-footer-panel a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 150ms;
    white-space: nowrap;
}

.magica-footer-panel a:hover { color: var(--color-light); }


.magica-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    font-size: 0.8rem;
}

.magica-footer-payment {
    width: 100%;
    display: flex;
    justify-content: center;
}

.magica-footer-copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
}

@media (max-width: 600px) {
    .magica-footer-bottom {
        align-items: center;
    }
    .magica-footer-copyright {
        text-align: center;
    }
    .magica-payment-badges {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .magica-footer-grid {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }
    .magica-footer-brand,
    .magica-footer-right {
        display: grid;
        grid-template-columns: 1fr 140px;
        align-items: center;
        width: 100%;
    }
    .magica-footer-brand__mascot,
    .magica-footer-social {
        width: 140px;
        justify-self: center;
    }
    .magica-footer-col-nav {
        align-self: stretch;
        justify-self: start;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
    }
    .magica-footer-social {
        align-items: center;
        justify-content: center;
    }
    .magica-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

