/* =========================================================
   MI HUELLITA
   HEADER.CSS
   ========================================================= */


/* =========================
   VARIABLES
   ========================= */

:root {
    --purple: #4b168d;
    --purple-dark: #30105f;
    --purple-medium: #6125a4;
    --purple-light: #eee6fb;

    --pink: #e92670;

    --text: #24173a;
    --muted: #756b83;

    --white: #ffffff;

    --border: #e8e1f1;

    --shadow-sm: 0 5px 18px rgba(67, 27, 116, 0.08);

    --transition: all 0.3s ease;
}


/* =========================
   RESET DEL HEADER
   ========================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Nunito", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
    min-height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 25px;

    padding: 8px 20px;

    background: var(--purple-dark);
    color: var(--white);

    font-size: 13px;
    font-weight: 700;

    text-align: center;
}

.topbar span {
    display: inline-flex;
    align-items: center;

    gap: 7px;
}

.topbar span:nth-child(2),
.topbar span:nth-child(4) {
    opacity: 0.45;
}


/* =========================================================
   HEADER
   ========================================================= */

header {
    position: sticky;
    top: 0;

    z-index: 1000;

    width: 100%;
    height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 5%;

    background: rgba(255, 255, 255, 0.97);

    border-bottom: 1px solid #eee;

    backdrop-filter: blur(14px);

    transition: var(--transition);
}


/* HEADER AL HACER SCROLL */

header.scrolled {
    height: 70px;

    box-shadow: var(--shadow-sm);
}


/* =========================================================
   LOGO
   ========================================================= */

.logo {
    display: flex;
    align-items: center;

    gap: 12px;

    flex-shrink: 0;
}


/* CÍRCULO DE LA HUELLITA */

.logo-paw {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--purple);
    color: var(--white);

    font-size: 27px;

    box-shadow:
        0 6px 16px rgba(75, 22, 141, 0.22);

    transition: var(--transition);
}


/* EFECTO DEL LOGO */

.logo:hover .logo-paw {
    transform: rotate(-8deg) scale(1.05);
}


/* TEXTO DEL LOGO */

.logo-text strong {
    display: block;

    color: var(--purple);

    font-size: 27px;
    line-height: 1;

    font-weight: 900;
}

.logo-text small {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.2;

    font-weight: 700;
}


/* =========================================================
   NAVEGACIÓN
   ========================================================= */

nav {
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 38px;
}

nav a {
    position: relative;

    height: 100%;

    display: flex;
    align-items: center;

    color: #4d4359;

    font-size: 15px;
    font-weight: 700;

    transition: var(--transition);
}


/* LÍNEA DEBAJO */

nav a::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 0;

    width: 0;
    height: 3px;

    border-radius: 10px 10px 0 0;

    background: var(--purple);

    transform: translateX(-50%);

    transition: var(--transition);
}


/* HOVER Y ENLACE ACTIVO */

nav a:hover,
nav a.active {
    color: var(--purple);
}

nav a:hover::after,
nav a.active::after {
    width: 28px;
}


/* =========================================================
   ACCIONES DEL HEADER
   ========================================================= */

.header-actions {
    display: flex;
    align-items: center;

    gap: 22px;

    color: var(--purple);
}

.header-actions > span {
    position: relative;

    width: 28px;
    height: 28px;

    display: grid;
    place-items: center;

    font-size: 23px;

    cursor: pointer;

    transition: var(--transition);
}

.header-actions > span:hover {
    color: var(--purple-medium);

    transform: translateY(-2px);
}


/* =========================================================
   CONTADOR DEL CARRITO
   ========================================================= */

.cart-count {
    position: absolute;

    top: -7px;
    right: -8px;

    width: 18px;
    height: 18px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--pink);
    color: var(--white);

    font-size: 10px !important;
    font-weight: 900;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    header {
        padding: 0 3%;
    }

    nav {
        gap: 22px;
    }
}


/* =========================================================
   TABLET PEQUEÑO
   ========================================================= */

@media (max-width: 800px) {

    .topbar {
        gap: 10px;

        font-size: 10px;
    }

    header {
        height: 72px;
    }

    /* Ocultar navegación */

    nav {
        display: none;
    }

    .header-actions {
        gap: 13px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .topbar {
        min-height: 34px;

        padding: 7px 10px;

        font-size: 9px;

        gap: 5px;
    }

    /* Ocultar separadores */

    .topbar span:nth-child(2),
    .topbar span:nth-child(4) {
        display: none;
    }


    /* HEADER */

    header {
        height: 68px;

        padding: 0 17px;
    }


    /* LOGO */

    .logo {
        gap: 8px;
    }

    .logo-paw {
        width: 39px;
        height: 39px;

        font-size: 21px;
    }

    .logo-text strong {
        font-size: 21px;
    }

    .logo-text small {
        font-size: 8px;
    }


    /* ACCIONES */

    .header-actions {
        gap: 8px;
    }

    .header-actions > span {
        font-size: 19px;
    }
}


/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

button:focus-visible,
a:focus-visible {

    outline: 3px solid rgba(75, 22, 141, .35);

    outline-offset: 3px;
}


/* =========================================================
   REDUCE MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    * {
        animation-duration: .01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: .01ms !important;
    }
}