/**
 * CalmPet – nagłówek: pasek rabatu, logo i przycisk koszyka (template-parts/site/header.php).
 */

.calmpet-site-header {
    position: relative;
    z-index: 9990;
    width: 100%;
    font-family: inherit;
    background: #FFFFFF;
}

.calmpet-header-container {
    width: min(100% - 32px, 1280px);
    margin: 0 auto;
}

.calmpet-top-bar {
    background: #EEF3EA;
    color: #123C3A;
    border-bottom: 1px solid rgba(167, 198, 164, 0.45);
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    text-align: center;
    padding: 8px 0;
}

.calmpet-main-nav {
    background: #FFFFFF;
    border-bottom: 1px solid rgba(167, 198, 164, 0.42);
    box-shadow: 0 8px 22px rgba(18, 60, 58, 0.06);
}

.calmpet-nav-inner {
    min-height: 54px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.calmpet-nav-spacer {
    min-width: 44px;
}

.calmpet-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.calmpet-header-logo {
    display: block;
    width: auto;
    height: 38px;
    max-width: 180px;
    object-fit: contain;
    box-shadow: none !important;
}

.calmpet-cart-trigger {
    position: relative;
    justify-self: end;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(167, 198, 164, 0.55);
    background: #FBF6EE;
    color: #123C3A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.calmpet-cart-trigger:hover {
    background: #EEF3EA;
    border-color: rgba(18, 60, 58, 0.32);
    transform: translateY(-1px);
}

.calmpet-cart-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    display: block;
}

.calmpet-cart-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #F28C52;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
}

.calmpet-cart-badge.is-empty {
    display: none;
}

@media (max-width: 768px) {
    .calmpet-header-container {
        width: min(100% - 24px, 1280px);
    }

    .calmpet-top-bar {
        font-size: 11.5px;
        padding: 7px 0;
    }

    .calmpet-nav-inner {
        min-height: 52px;
        gap: 10px;
    }

    .calmpet-header-logo {
        height: 32px;
        max-width: 150px;
    }

    .calmpet-cart-trigger {
        width: 40px;
        height: 40px;
    }

    .calmpet-cart-icon {
        width: 21px;
        height: 21px;
    }
}

/* Pasek rabatu (Igor 2026-10-08): kod do skopiowania i dzienny licznik do 00:00 czasu polskiego. */
.calmpet-top-bar--rabat {
    background: #164036;
    color: #FFFFFF;
    border-bottom: 0;
    font-weight: 500;
}

.calmpet-rabat {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 4px 8px;
}

.calmpet-rabat__oferta {
    white-space: nowrap;
}

.calmpet-rabat__oferta strong {
    color: #FFD24D;
    font-weight: 800;
}

.calmpet-rabat__kod {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 3px 10px;
    border: 0;
    border-radius: 6px;
    background: #FFD24D; /* Igor 2026-10-08: kod zawsze na pełnym żółtym tle, bez białej przerywanej ramki */
    color: #164036;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.calmpet-rabat__kod svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calmpet-rabat__kod.is-skopiowany {
    background: #FFD24D;
    color: #164036;
}

.calmpet-rabat__kod:focus-visible {
    outline: 2px solid #F2A98E;
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .calmpet-rabat__kod:hover {
        background: #FFDC6E;
    }
}

.calmpet-rabat__waznosc {
    white-space: nowrap;
    color: #FF8F95;
    font-weight: 600;
}

.calmpet-rabat__waznosc strong {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    /* Dwie zwarte linie: większa oferta i kod, pod nimi jasnoczerwony licznik. */
    .calmpet-top-bar--rabat {
        font-size: clamp(11px, 3.33vw, 13px);
        line-height: 1.2;
        padding: 6px 0;
    }

    .calmpet-rabat {
        width: min(100% - 20px, 1280px);
        flex-wrap: wrap;
        gap: 2px 8px;
    }

    .calmpet-rabat__waznosc {
        flex-basis: 100%;
        font-size: 12.5px;
        line-height: 1.1;
    }

    .calmpet-rabat__kod {
        padding: 3px 8px;
        gap: 5px;
        letter-spacing: 0.02em;
    }

    .calmpet-rabat__kod svg {
        width: 12px;
        height: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calmpet-rabat__kod {
        transition: none;
    }
}
