/* FERUMI — sistema visual compartido: tipografía, botones, cabecera, carrito, tarjetas y pie.
   Los colores de marca viven en style.css (:root) y no se redefinen acá. */

:root {
    --ink: #2b1f27;
    --ink-soft: #6a5a64;
    --blush: #fff8fc;
    --radius-lg: 22px;
    --radius-md: 16px;
    --shadow-soft: 0 18px 40px -26px rgba(190, 60, 120, 0.45);
    --shadow-lift: 0 26px 48px -28px rgba(190, 60, 120, 0.55);
    --header-h: 64px;
    --gutter: 18px;
    --content-w: 1240px;
}

body {
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.fm-lock { overflow: hidden; }
body h1, body h2, body h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.01em; line-height: 1.18; }
body h1 em, body h2 em { font-style: italic; font-weight: 500; color: var(--primary-color); }
body a:focus-visible, body button:focus-visible, body input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
:target { scroll-margin-top: calc(var(--header-h) + 12px); }

.fm-kicker {
    font-family: var(--font-family-body);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--primary-color-dark);
    margin: 0 0 0.6rem;
}

/* ---------- Botones ---------- */
body .btn {
    min-height: 48px;
    padding: 0.8rem 1.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    font-weight: 600;
    box-shadow: none;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
body .btn:hover { transform: translateY(-1px); box-shadow: none; }
body .btn-primary {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #fff;
    box-shadow: 0 14px 26px -16px rgba(221, 81, 143, 0.9);
}
body .btn-primary:hover { background: var(--primary-color-dark); border-color: var(--primary-color-dark); color: #fff; }
body .btn-secondary { background: #fff; border: 1px solid rgba(242, 90, 164, 0.35); color: var(--ink); }
body .btn-secondary:hover { background: var(--primary-color-light); border-color: var(--primary-color); color: var(--ink); }
body .btn-sm { min-height: 42px; padding: 0.55rem 1.1rem; }

/* ---------- Cabecera ---------- */
body header.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid rgba(242, 90, 164, 0.12);
    box-shadow: none;
}
body header.main-header .navbar-container {
    height: var(--header-h);
    max-width: var(--content-w);
    padding: 0 var(--gutter);
    gap: 0.5rem;
}
body .navbar-brand a.fm-logo { display: flex; align-items: center; padding: 0; min-height: 44px; }
body .navbar-brand .fm-logo img { height: 38px; width: auto; margin: 0; }
body header.main-header .navbar-container .navbar-nav { display: none; }
body header.main-header .navbar-actions { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
body header.main-header .navbar-container .navbar-actions .header-search { display: none; }

body header.main-header .navbar-container .cart-icon,
body header.main-header .navbar-container .mobile-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
}
body header.main-header .navbar-container .cart-icon:hover,
body header.main-header .navbar-container .mobile-menu-icon:hover { background: var(--primary-color-light); }
body .cart-count {
    position: absolute;
    top: 3px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
body .cart-count[data-count="0"] { display: none; }

@media (min-width: 1100px) {
    :root { --header-h: 76px; --gutter: 28px; }
    body .navbar-brand .fm-logo img { height: 46px; }
    body header.main-header .navbar-container .navbar-nav {
        display: flex;
        flex: 1;
        justify-content: center;
        gap: 0.15rem;
    }
    body header.main-header .navbar-container .navbar-nav a {
        position: relative;
        padding: 0.6rem 0.8rem;
        font-size: 0.7rem;
        letter-spacing: 0.14em;
        font-weight: 600;
        color: var(--ink-soft);
        border-bottom: 0;
    }
    body header.main-header .navbar-container .navbar-nav a::after {
        content: '';
        position: absolute;
        left: 0.8rem;
        right: 0.8rem;
        bottom: 0.2rem;
        height: 2px;
        border-radius: 2px;
        background: var(--primary-color);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.3s ease;
    }
    body header.main-header .navbar-container .navbar-nav a:hover,
    body header.main-header .navbar-container .navbar-nav a.active { color: var(--ink); border-bottom: 0; }
    body header.main-header .navbar-container .navbar-nav a:hover::after,
    body header.main-header .navbar-container .navbar-nav a.active::after { transform: scaleX(1); }
    body header.main-header .navbar-container .navbar-actions { margin-left: 0; }
    body header.main-header .navbar-container .navbar-actions .header-search { display: block; }
    body header.main-header .navbar-container .mobile-menu-icon { display: none; }
}

body .header-search { position: relative; }
body .header-search-input {
    width: 190px;
    height: 42px;
    padding: 0 1rem 0 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--blush);
    font-family: var(--font-family-body);
    font-size: 0.85rem;
    transition: width 0.3s ease, border-color 0.2s ease, background-color 0.2s ease;
}
body .header-search-input:focus { width: 260px; background: #fff; border-color: var(--primary-color); outline: none; }
body .header-search i { left: 1rem; font-size: 0.85rem; pointer-events: none; }
body #search-results-popup { width: 320px; border-radius: var(--radius-md); overflow: hidden; border-color: rgba(242, 90, 164, 0.18); box-shadow: var(--shadow-soft); }

/* ---------- Menú móvil ---------- */
body nav.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(88vw, 360px);
    height: 100%;
    padding: 0.9rem 1.1rem 1.4rem;
    gap: 0.6rem;
    background: #fff;
    z-index: 2000;
    overflow-y: auto;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.32s ease, visibility 0s linear 0.32s;
    box-shadow: -24px 0 50px -30px rgba(43, 31, 39, 0.5);
}
body nav.mobile-nav-panel.active { transform: none; visibility: visible; transition: transform 0.32s ease; }
body .mobile-nav-overlay { background: rgba(43, 31, 39, 0.45); z-index: 1999; }
.mnav-head .fm-logo, body nav.mobile-nav-panel .mnav-head a { width: auto; padding: 0; background: transparent; }
.mnav-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.mnav-head .fm-logo img { height: 36px; width: auto; }
.mnav-close {
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: var(--primary-color-light); color: var(--ink); font-size: 1.05rem; cursor: pointer;
}
.mnav-search { position: relative; margin: 0.5rem 0 0.4rem; }
.mnav-search i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--ink-soft); font-size: 0.85rem; }
.mnav-search input {
    width: 100%; height: 48px; padding: 0 1rem 0 2.6rem;
    border: 1px solid var(--border-color); border-radius: 999px;
    background: var(--blush); font: inherit; font-size: 0.95rem;
}
.mnav-search input:focus { outline: none; border-color: var(--primary-color); background: #fff; }
body nav.mobile-nav-panel .navbar-nav { display: flex; flex-direction: column; gap: 0; width: 100%; }
body nav.mobile-nav-panel .navbar-nav a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 0 0.4rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-family-headings);
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink);
}
body nav.mobile-nav-panel .navbar-nav a.active { color: var(--primary-color-dark); }
body nav.mobile-nav-panel .navbar-nav a:hover { background: transparent; color: var(--primary-color-dark); }
body nav.mobile-nav-panel .navbar-nav a.shop-hide { display: none !important; }
.mnav-wa {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    margin-top: 1rem; min-height: 50px; border-radius: 999px;
    background: var(--ink); color: #fff; font-weight: 600; font-size: 0.85rem;
}
body nav.mobile-nav-panel a.mnav-wa { width: 100%; padding: 0 1rem; color: #fff; }
body nav.mobile-nav-panel a.mnav-wa:hover { color: #fff; background: #000; }

/* ---------- Carrito ---------- */
body .cart-overlay { background: rgba(43, 31, 39, 0.45); z-index: 2100; }
body .cart-sidebar {
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    z-index: 2101;
    background: #fff;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.32s ease, visibility 0s linear 0.32s;
    box-shadow: -24px 0 50px -30px rgba(43, 31, 39, 0.5);
}
body .cart-sidebar.active { transform: none; visibility: visible; transition: transform 0.32s ease; }
body .cart-header { padding: 14px 18px; border-bottom: 1px solid var(--border-color); }
body .cart-header h3 { margin: 0; font-size: 1.4rem; color: var(--ink); }
body .close-cart { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--primary-color-light); color: var(--ink); cursor: pointer; }
body .cart-items { padding: 6px 18px; }
body .cart-item { gap: 14px; padding: 14px 0; margin: 0; border-bottom: 1px solid var(--border-color); align-items: flex-start; }
body .cart-item img { width: 72px; height: 90px; border-radius: 12px; object-fit: cover; background: var(--primary-color-light); flex-shrink: 0; }
body .cart-item-details { flex: 1; min-width: 0; }
body .cart-item-title { font-family: var(--font-family-body); font-size: 0.92rem; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 0 0 2px; }
body .cart-item-price { margin: 0 0 8px; color: var(--primary-color-dark); font-weight: 700; font-size: 0.9rem; }
body .cart-item-qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-color); border-radius: 999px; padding: 2px; }
body .cart-item-qty span { min-width: 26px; text-align: center; font-weight: 600; font-size: 0.9rem; }
body .qty-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--blush); color: var(--ink); font-size: 1rem; line-height: 1; cursor: pointer; }
body .qty-btn:hover { background: var(--primary-color-light); }
body .remove-item { width: 44px; height: 44px; margin: -8px -10px 0 0; border: 0; border-radius: 50%; background: transparent; color: #a5949d; cursor: pointer; }
body .remove-item:hover { color: var(--primary-color-dark); }
.cart-empty { text-align: center; padding: 3.2rem 1rem; color: var(--ink-soft); }
.cart-empty i { font-size: 2.4rem; color: var(--primary-color-light); margin-bottom: 0.8rem; }
.cart-empty p { margin-bottom: 1.2rem; }
.cart-discount-info { padding: 0.8rem 0; color: #1f8f4d; font-size: 0.9rem; }
body .cart-footer { padding: 14px 18px 18px; border-top: 1px solid var(--border-color); background: var(--blush); }
.cart-coupon label { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.cart-coupon-row { display: flex; gap: 8px; }
.cart-coupon-row .form-control { height: 44px; padding: 0 14px; font-size: 0.9rem; border-radius: 999px; }
.cart-coupon-row .btn { min-height: 44px; padding: 0 1.2rem; }
.cart-coupon-message { display: block; margin-top: 6px; font-weight: 600; }
body .cart-total { margin: 14px 0 12px; font-size: 1.1rem; font-weight: 700; }
body .cart-total span:last-child { color: var(--primary-color-dark); font-size: 1.25rem; }
.cart-checkout-stack { display: grid; gap: 8px; }
.btn-checkout-main, .btn-checkout-wa {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    min-height: 52px; border-radius: 999px; border: 1px solid transparent;
    font-family: var(--font-family-body); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
    cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-checkout-main { background: var(--primary-color); color: #fff; }
.btn-checkout-main:hover { background: var(--primary-color-dark); }
.btn-checkout-wa { background: #fff; color: var(--ink); border-color: var(--border-color); }
.btn-checkout-wa i { color: #25d366; font-size: 1.1rem; }
.btn-checkout-wa:hover { background: var(--primary-color-light); }

body .floating-cart-btn {
    position: fixed; right: 16px; bottom: 16px; z-index: 900;
    width: 56px; height: 56px; border: 0; border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    background: var(--primary-color); color: #fff; font-size: 1.15rem; cursor: pointer;
    box-shadow: 0 16px 30px -12px rgba(221, 81, 143, 0.75);
}
body .floating-cart-btn.has-items { display: flex; }
body.fm-product .floating-cart-btn { display: none; }
body .cart-badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
    background: var(--ink); color: #fff; border: 2px solid #fff;
    font-size: 0.68rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---------- Tarjetas de producto ---------- */
body .product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 0.8rem; }
body .product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    transition: none;
}
body .product-card:hover { transform: none; box-shadow: none; border-color: transparent; }
body .product-card .card-image-link {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--primary-color-light);
    aspect-ratio: 4 / 5;
}
body .product-card-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
body .product-card:hover .product-card-image { transform: scale(1.04); }
body .product-card .card-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    padding: 0.8rem 0.1rem 0;
    text-align: left;
}
body .product-card .card-category {
    margin: 0;
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    font-weight: 600;
    color: var(--primary-color-dark);
    text-transform: uppercase;
}
body .product-card .card-title {
    margin: 0;
    font-family: var(--font-family-body);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body .product-card .card-title a { color: var(--ink); }
body .product-card .card-title a:hover { color: var(--primary-color-dark); }
body .product-card .card-subtitle { display: none; }
body .product-card .card-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.1rem 0.5rem;
    margin: 0.15rem 0 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
}
body .product-card.is-promo .card-price { color: var(--primary-color-dark); }
body .product-card .price-old { order: 2; color: #9d8e97; text-decoration: line-through; font-weight: 500; font-size: 0.8rem; }
body .product-card .card-actions { margin-top: auto; padding-top: 0.7rem; }
body .product-card .card-actions .btn { width: 100%; margin: 0; min-height: 44px; padding: 0.5rem 0.8rem; font-size: 0.7rem; letter-spacing: 0.1em; }
body .product-card .btn-add:hover { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }
body .product-card.is-sold .card-image-link img { filter: grayscale(0.6); opacity: 0.8; }

.fm-badges { position: absolute; top: 10px; left: 10px; z-index: 2; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.fm-badge {
    display: inline-block;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.3;
}
.fm-badge-new { background: #fff; color: var(--ink); }
.fm-badge-sold { background: var(--ink); color: #fff; }

@media (min-width: 700px) {
    body .product-grid { gap: 2rem 1.2rem; }
    body .product-card .card-title { font-size: 0.98rem; }
}
@media (min-width: 900px) { body .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { body .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Pie ---------- */
body .site-footer {
    margin-top: 4rem;
    padding: 3rem var(--gutter) 1.4rem;
    background: #241820;
    color: rgba(255, 255, 255, 0.78);
    text-align: left;
    border: 0;
}
body .fm-footer {
    max-width: var(--content-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.2rem;
}
.fm-footer-brand { grid-column: 1 / -1; }
.fm-footer-brand img { height: 52px; width: auto; margin-bottom: 0.9rem; }
.fm-footer-brand p { max-width: 26rem; margin: 0 0 0.5rem; font-size: 0.92rem; color: rgba(255, 255, 255, 0.78); }
.fm-footer-brand .fm-footer-address { font-size: 0.85rem; color: rgba(255, 255, 255, 0.58); }
.fm-footer-brand .fm-footer-address i { color: var(--accent-color); margin-right: 0.35rem; }
.fm-footer-col h3 {
    font-family: var(--font-family-body);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin: 0 0 0.7rem;
}
.fm-footer-col { display: flex; flex-direction: column; align-items: flex-start; }
.fm-footer-col a { display: inline-flex; align-items: center; min-height: 40px; color: rgba(255, 255, 255, 0.82); font-size: 0.92rem; }
.fm-footer-col a:hover { color: #fff; }
.fm-footer-social { grid-column: 1 / -1; }
.fm-social-icons { display: flex; gap: 0.6rem; }
body .fm-footer-col .fm-social-icons a {
    width: 46px; height: 46px; justify-content: center; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22); font-size: 1.1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
body .fm-footer-col .fm-social-icons a:hover { background: var(--primary-color); border-color: var(--primary-color); }
body .fm-footer-base {
    max-width: var(--content-w);
    margin: 2rem auto 0;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.4rem 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}
body .fm-footer-base a { color: rgba(255, 255, 255, 0.6); display: inline-flex; align-items: center; min-height: 36px; }
body .fm-footer-base a:hover { color: #fff; }

@media (min-width: 900px) {
    body .site-footer { padding-top: 4rem; }
    body .fm-footer { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; }
    .fm-footer-brand, .fm-footer-social { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media (min-width: 1600px) { :root { --content-w: 1360px; } }
