/* =========================================================
   SAVVY LEATHER CRAFT
   HEADER
   ========================================================= */


/* ---------------------------------------------------------
   HEADER
   --------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;

    background: rgba(255, 255, 255, 0.96);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border-bottom: 1px solid var(--line);

    transition:
        background 0.3s ease,
        box-shadow 0.3s ease;
}


/* Slight shadow after scrolling */

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.98);

    box-shadow:
        0 8px 30px rgba(33, 27, 23, 0.06);
}


/* ---------------------------------------------------------
   HEADER INNER
   --------------------------------------------------------- */

.header-inner {
    min-height: 84px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 40px;
}


/* ---------------------------------------------------------
   BRAND
   --------------------------------------------------------- */

.brand {
    display: inline-flex;
    flex-direction: column;

    flex-shrink: 0;

    color: var(--black);

    line-height: 1;

    text-decoration: none;
}


.brand-name {
    font-family: var(--serif);

    font-size: 31px;
    font-weight: 600;

    letter-spacing: -1.4px;

    transition: color 0.3s ease;
}


.brand-subtitle {
    margin-top: 7px;

    color: var(--brown-2);

    font-size: 8px;
    font-weight: 700;

    letter-spacing: 3.4px;

    text-transform: uppercase;

    transition: color 0.3s ease;
}


.brand:hover .brand-name {
    color: var(--brown);
}


/* ---------------------------------------------------------
   DESKTOP NAVIGATION
   --------------------------------------------------------- */

.main-nav {
    display: flex;
    align-items: center;

    gap: 34px;

    margin-left: auto;
    margin-right: auto;
}


.nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;

    height: 84px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 600;

    letter-spacing: 0.2px;

    text-decoration: none;

    transition:
        color 0.25s ease;
}


.nav-link::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 24px;

    height: 1px;

    background: var(--black);

    transform: scaleX(0);
    transform-origin: center;

    transition:
        transform 0.3s ease;
}


.nav-link:hover,
.nav-link.active {
    color: var(--black);
}


.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}


/* ---------------------------------------------------------
   HEADER ACTIONS
   --------------------------------------------------------- */

.header-actions {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-shrink: 0;
}


/* ---------------------------------------------------------
   CART
   --------------------------------------------------------- */

.cart-button {
    display: inline-flex;
    align-items: center;

    gap: 9px;

    min-height: 42px;

    padding: 0 13px;

    color: var(--black);

    border: 1px solid var(--line);

    background: #fff;

    text-decoration: none;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}


.cart-button:hover {
    background: var(--black);

    color: #fff;

    border-color: var(--black);

    transform: translateY(-1px);
}


.cart-icon {
    width: 17px;
    height: 17px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.cart-icon svg {
    width: 17px;
    height: 17px;
}


.cart-label {
    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.5px;
}


.cart-count {
    min-width: 21px;
    height: 21px;

    padding: 0 5px;

    display: inline-grid;
    place-items: center;

    border-radius: 50%;

    background: var(--black);
    color: #fff;

    font-size: 9px;
    font-weight: 700;

    transition:
        background 0.25s ease,
        color 0.25s ease;
}


.cart-button:hover .cart-count {
    background: #fff;
    color: var(--black);
}


/* ---------------------------------------------------------
   MOBILE MENU BUTTON
   --------------------------------------------------------- */

.mobile-menu-button {
    position: relative;

    display: none;

    width: 43px;
    height: 43px;

    padding: 0;

    border: 1px solid var(--line);

    background: #fff;

    cursor: pointer;

    transition:
        background 0.25s ease,
        border-color 0.25s ease;
}


.mobile-menu-button:hover {
    background: var(--cream);
}


.mobile-menu-button span {
    position: absolute;

    left: 12px;

    width: 18px;
    height: 1.5px;

    background: var(--black);

    transition:
        transform 0.3s ease,
        top 0.3s ease;
}


.mobile-menu-button span:first-child {
    top: 16px;
}


.mobile-menu-button span:last-child {
    top: 24px;
}


/* Menu open */

.mobile-menu-button.is-open span:first-child {
    top: 20px;

    transform: rotate(45deg);
}


.mobile-menu-button.is-open span:last-child {
    top: 20px;

    transform: rotate(-45deg);
}


/* ---------------------------------------------------------
   MOBILE OVERLAY
   --------------------------------------------------------- */

.mobile-menu-overlay {
    position: fixed;

    inset: 0;

    z-index: 1090;

    background: rgba(17, 16, 15, 0.42);

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;
}


.mobile-menu-overlay.is-visible {
    opacity: 1;

    visibility: visible;
}


/* ---------------------------------------------------------
   MOBILE NAV
   --------------------------------------------------------- */

.mobile-nav {
    position: fixed;

    top: 0;
    right: 0;

    z-index: 1100;

    width: min(390px, 88vw);
    height: 100dvh;

    display: flex;
    flex-direction: column;

    background: #fff;

    box-shadow:
        -20px 0 50px rgba(17, 16, 15, 0.12);

    transform: translateX(100%);

    visibility: hidden;

    transition:
        transform 0.4s cubic-bezier(.22, .61, .36, 1),
        visibility 0.4s ease;

    overflow-y: auto;
}


.mobile-nav.is-open {
    transform: translateX(0);

    visibility: visible;
}


/* ---------------------------------------------------------
   MOBILE NAV HEADER
   --------------------------------------------------------- */

.mobile-nav-header {
    min-height: 100px;

    padding: 24px 24px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--line);
}


.mobile-brand {
    display: flex;
    flex-direction: column;

    color: var(--black);

    text-decoration: none;

    line-height: 1;
}


.mobile-brand-name {
    font-family: var(--serif);

    font-size: 27px;
    font-weight: 600;

    letter-spacing: -1px;
}


.mobile-brand-subtitle {
    margin-top: 6px;

    color: var(--brown-2);

    font-size: 7px;
    font-weight: 700;

    letter-spacing: 2.5px;

    text-transform: uppercase;
}


/* ---------------------------------------------------------
   MOBILE CLOSE BUTTON
   --------------------------------------------------------- */

.mobile-nav-close {
    position: relative;

    width: 40px;
    height: 40px;

    padding: 0;

    border: 1px solid var(--line);

    background: #fff;

    cursor: pointer;
}


.mobile-nav-close span {
    position: absolute;

    top: 19px;
    left: 10px;

    width: 18px;
    height: 1px;

    background: var(--black);
}


.mobile-nav-close span:first-child {
    transform: rotate(45deg);
}


.mobile-nav-close span:last-child {
    transform: rotate(-45deg);
}


/* ---------------------------------------------------------
   MOBILE LINKS
   --------------------------------------------------------- */

.mobile-nav-links {
    padding: 12px 24px 20px;
}


.mobile-nav-link {
    position: relative;

    min-height: 70px;

    display: grid;

    grid-template-columns: 34px 1fr auto;

    align-items: center;

    gap: 14px;

    color: var(--black);

    border-bottom: 1px solid var(--line);

    font-size: 17px;
    font-weight: 500;

    text-decoration: none;

    transition:
        padding-left 0.25s ease,
        color 0.25s ease;
}


.mobile-nav-link:hover {
    padding-left: 6px;

    color: var(--brown);
}


.mobile-nav-number {
    color: #a49a91;

    font-family: var(--serif);

    font-size: 11px;
    font-style: italic;
}


.mobile-nav-arrow {
    color: #8f857c;

    font-size: 18px;

    transition:
        transform 0.25s ease,
        color 0.25s ease;
}


.mobile-nav-link:hover .mobile-nav-arrow {
    color: var(--black);

    transform: translateX(4px);
}


/* Active link */

.mobile-nav-link.active {
    font-weight: 600;
}


.mobile-nav-link.active .mobile-nav-number {
    color: var(--brown);
}


.mobile-nav-link.active .mobile-nav-arrow {
    color: var(--brown);
}


/* ---------------------------------------------------------
   MOBILE CART
   --------------------------------------------------------- */

.mobile-cart-link {
    grid-template-columns: 34px 1fr auto;
}


.mobile-cart-badge {
    min-width: 25px;
    height: 25px;

    padding: 0 7px;

    display: inline-grid;
    place-items: center;

    border-radius: 50%;

    background: var(--black);
    color: #fff;

    font-size: 10px;
    font-weight: 700;
}


/* ---------------------------------------------------------
   MOBILE FOOTER
   --------------------------------------------------------- */

.mobile-nav-footer {
    margin-top: auto;

    padding: 26px 24px 30px;

    border-top: 1px solid var(--line);

    background: var(--cream);
}


.mobile-nav-footer p {
    margin: 0 0 7px;

    color: var(--black);

    font-family: var(--serif);

    font-size: 18px;
}


.mobile-nav-footer span {
    color: var(--muted);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1.7px;

    text-transform: uppercase;
}


/* ---------------------------------------------------------
   BODY LOCK WHEN MOBILE MENU IS OPEN
   --------------------------------------------------------- */

body.mobile-menu-open {
    overflow: hidden;
}


/* ---------------------------------------------------------
   TABLET
   --------------------------------------------------------- */

@media (max-width: 1050px) {

    .header-inner {
        gap: 24px;
    }

    .main-nav {
        gap: 23px;
    }

    .nav-link {
        font-size: 11px;
    }

}


/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 820px) {

    .header-inner {
        min-height: 72px;
    }


    .main-nav {
        display: none;
    }


    .mobile-menu-button {
        display: block;
    }


    .cart-button {
        min-height: 42px;

        padding: 0 11px;
    }


    .cart-label {
        display: none;
    }


    .brand-name {
        font-size: 28px;
    }


    .brand-subtitle {
        margin-top: 5px;

        font-size: 7px;

        letter-spacing: 2.8px;
    }

}


/* ---------------------------------------------------------
   SMALL MOBILE
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .header-inner {
        min-height: 68px;
    }


    .brand-name {
        font-size: 25px;
    }


    .brand-subtitle {
        font-size: 6.5px;

        letter-spacing: 2.4px;
    }


    .cart-button {
        min-width: 42px;
        width: 42px;
        height: 42px;

        padding: 0;

        justify-content: center;
    }


    .cart-icon {
        width: 16px;
        height: 16px;
    }


    .cart-icon svg {
        width: 16px;
        height: 16px;
    }


    .cart-count {
        position: absolute;

        margin-top: -27px;
        margin-left: 25px;

        min-width: 18px;
        height: 18px;

        padding: 0;

        font-size: 8px;
    }


    .mobile-menu-button {
        width: 42px;
        height: 42px;
    }


    .mobile-nav {
        width: min(360px, 91vw);
    }


    .mobile-nav-header {
        min-height: 92px;

        padding: 20px;
    }


    .mobile-nav-links {
        padding-left: 20px;
        padding-right: 20px;
    }


    .mobile-nav-link {
        min-height: 65px;

        font-size: 16px;
    }


    .mobile-nav-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

}


/* ---------------------------------------------------------
   REDUCED MOTION
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    .site-header,
    .nav-link,
    .nav-link::after,
    .mobile-menu-button span,
    .mobile-menu-overlay,
    .mobile-nav,
    .mobile-nav-link,
    .mobile-nav-arrow {
        transition: none;
    }

}