/* ==========================================================================
   India Pet Shop — Site header & footer (every frontend page)
   ========================================================================== */

/* The header is now in normal flow, so pages no longer need to leave room
   for an absolutely positioned header (they used to). */
:root {
    --hm-header-h: 0px;
    --sh-top-h: 38px;
    /* Height of the sticky main bar; sticky page elements sit below it. */
    --sh-main-h: 74px;
}

/* The theme's `main { overflow: hidden }` breaks position: sticky. `clip`
   still hides sideways overflow without that side effect. */
main {
    overflow: visible !important;
    overflow-x: clip !important;
}

/* Sticky: the announcement bar scrolls away, the main bar stays. */
#header {
    position: sticky;
    top: calc(var(--sh-top-h) * -1);
    z-index: 1000;
}

.sh,
.sf {
    font-family: var(--hm-font);
    color: var(--hm-ink);
}

.sh *,
.sh *::before,
.sh *::after,
.sf *,
.sf *::before,
.sf *::after {
    box-sizing: border-box;
}

.sh :where(ul, p, h2, h3),
.sf :where(ul, p, h2, h3) {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sh :where(a),
.sf :where(a) {
    color: inherit;
    text-decoration: none;
}

.sh :where(img),
.sf :where(img) {
    display: block;
    max-width: 100%;
}

.sh :where(button, input),
.sf :where(button, input) {
    font-family: inherit;
}

.sh-container,
.sf-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Announcement bar ---------- */

.sh-top {
    height: var(--sh-top-h);
    background: var(--hm-primary);
    color: var(--hm-white);
    font-size: 13px;
}

.sh-top__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sh-top__msg {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.sh-top__msg i {
    margin-right: 6px;
    color: #ffd166;
}

.sh-top__links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

.sh-top__links a {
    opacity: 0.9;
}

.sh-top__links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.sh-top__links i {
    margin-right: 4px;
}

.sh-donate {
    margin: 0;
    display: flex;
    align-items: center;
    transform: scale(0.82);
    transform-origin: right center;
}

/* ---------- Main bar ---------- */

.sh-main {
    position: relative;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--hm-line);
    box-shadow: 0 6px 20px rgba(29, 27, 47, 0.04);
}

.sh-main__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 74px;
}

.sh-logo img {
    height: 50px;
    width: auto;
}

.sh-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--hm-ink);
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sh-icon:hover {
    background: #f3f1f9;
    color: var(--hm-primary);
}

.sh-icon span:not(.sh-badge) {
    font-size: 14px;
    font-weight: 600;
}

.sh-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--hm-pink);
    color: var(--hm-white);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--hm-white);
    box-sizing: content-box;
}

.sh-badge--primary {
    background: var(--hm-primary);
}

.sh-burger,
.sh-search-toggle {
    display: none;
}

/* Navigation */

.sh-nav > ul {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sh-nav > ul > li > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #3b3950;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.sh-nav > ul > li > a i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.sh-nav > ul > li > a:hover,
.sh-nav > ul > li > a.is-active,
.sh-nav > ul > li.has-menu:hover > a {
    color: var(--hm-primary);
    background: var(--hm-primary-soft);
}

.sh-nav > ul > li.has-menu:hover > a i {
    transform: rotate(180deg);
}

/* Mega menus span the header width */
.sh-mega {
    position: absolute;
    left: 24px;
    right: 24px;
    top: calc(100% - 6px);
    background: var(--hm-white);
    border: 1px solid var(--hm-line);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(29, 27, 47, 0.15);
    padding: 26px 28px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 20;
}

.sh-nav li.has-menu:hover > .sh-mega,
.sh-nav li.has-menu:focus-within > .sh-mega {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sh-mega__cols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px 28px;
}

.sh-mega__col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sh-mega__col a {
    font-size: 14px;
    color: #4a4860;
}

.sh-mega__col a:hover {
    color: var(--hm-primary);
}

.sh-mega__col .sh-mega__head {
    font-size: 15px;
    font-weight: 700;
    color: var(--hm-ink);
    margin-bottom: 2px;
}

.sh-mega__all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--hm-primary) !important;
}

.sh-brands {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
}

.sh-brands a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.15s ease;
}

.sh-brands a:hover {
    background: #f7f6fb;
    color: var(--hm-primary);
}

.sh-brands img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid var(--hm-line);
    background: var(--hm-white);
}

/* Search */

.sh-search {
    position: relative;
    flex: 1;
    max-width: 380px;
    margin: 0 0 0 auto;
}

.sh-search > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hm-muted);
    font-size: 14px;
    pointer-events: none;
}

.sh-search input {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--hm-line);
    border-radius: 999px;
    background: #f7f6fb;
    padding: 0 18px 0 42px;
    font-size: 14.5px;
    color: var(--hm-ink);
    outline: 0;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.sh-search input::placeholder {
    text-transform: none;
    color: #9a97ab;
}

.sh-search input:focus {
    border-color: var(--hm-primary);
    background: var(--hm-white);
    box-shadow: 0 0 0 4px rgba(91, 47, 214, 0.1);
}

.sh-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: var(--hm-white);
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(29, 27, 47, 0.15);
    overflow: hidden;
    z-index: 30;
}

.sh-suggest[hidden] {
    display: none;
}

.sh-suggest__list {
    max-height: 380px;
    overflow-y: auto;
    padding: 6px !important;
}

.sh-suggest__list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13.5px;
}

.sh-suggest__list a:hover,
.sh-suggest__list a.is-active {
    background: #f7f6fb;
}

.sh-suggest__list img {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 10px;
    background: #faf9fd;
}

.sh-suggest__title {
    flex: 1;
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.sh-suggest__list strong {
    font-size: 13.5px;
    white-space: nowrap;
}

.sh-suggest__all {
    display: block;
    padding: 12px 16px;
    border-top: 1px solid var(--hm-line);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--hm-primary) !important;
}

.sh-suggest__empty {
    padding: 18px 16px !important;
    font-size: 14px;
    color: var(--hm-muted);
    text-align: center;
}

/* Actions */

.sh-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sh-account {
    position: relative;
}

.sh-account__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 240px;
    background: var(--hm-white);
    border: 1px solid var(--hm-line);
    border-radius: 16px;
    box-shadow: 0 24px 50px rgba(29, 27, 47, 0.15);
    padding: 8px;
    z-index: 30;
}

.sh-account__menu[hidden] {
    display: none;
}

.sh-account__who {
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--hm-line);
    margin-bottom: 6px;
}

.sh-account__who strong {
    display: block;
    font-size: 14px;
}

.sh-account__who span {
    display: block;
    font-size: 12px;
    color: var(--hm-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-account__menu a,
.sh-account__menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-size: 14px;
    color: #3b3950;
    text-align: left;
    cursor: pointer;
}

.sh-account__menu a:hover,
.sh-account__menu button:hover {
    background: #f7f6fb;
    color: var(--hm-primary);
}

.sh-account__menu i {
    width: 16px;
    color: var(--hm-muted);
}

.sh-account__menu form {
    margin: 4px 0 0;
    padding-top: 4px;
    border-top: 1px solid var(--hm-line);
}

.sh-account__menu form button {
    color: #b42318;
}

/* ---------- Mobile drawer ---------- */

.sh-drawer {
    position: fixed;
    inset: 0;
    z-index: 10040;
    visibility: hidden;
    pointer-events: none;
}

.sh-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.sh-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(29, 27, 47, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sh-drawer.is-open .sh-drawer__overlay {
    opacity: 1;
}

.sh-drawer__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(340px, 88%);
    background: var(--hm-white);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    outline: 0;
    overflow-y: auto;
}

.sh-drawer.is-open .sh-drawer__panel {
    transform: translateX(0);
}

.sh-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hm-line);
}

.sh-drawer__head img {
    height: 40px;
    width: auto;
}

.sh-drawer__user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 16px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--hm-primary), #7a52ec);
    color: var(--hm-white);
}

.sh-drawer__avatar {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.sh-drawer__user strong {
    display: block;
    font-size: 15px;
}

.sh-drawer__user a {
    font-size: 13px;
    opacity: 0.9;
}

.sh-drawer__nav {
    display: flex;
    flex-direction: column;
    padding: 4px 10px 16px;
}

.sh-drawer__nav > a,
.sh-drawer__nav summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #3b3950;
    cursor: pointer;
    list-style: none;
}

.sh-drawer__nav summary::-webkit-details-marker {
    display: none;
}

.sh-drawer__nav summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 11px;
    margin-left: auto;
    color: var(--hm-muted);
    transition: transform 0.2s ease;
}

.sh-drawer__nav details[open] summary::after {
    transform: rotate(180deg);
}

.sh-drawer__nav > a i,
.sh-drawer__nav summary i {
    width: 20px;
    text-align: center;
    color: var(--hm-primary);
}

.sh-drawer__nav > a:active,
.sh-drawer__nav summary:active {
    background: #f7f6fb;
}

.sh-drawer__sub {
    display: flex;
    flex-direction: column;
    margin: 0 0 8px 46px;
    border-left: 2px solid var(--hm-line);
}

.sh-drawer__sub a {
    padding: 9px 14px;
    font-size: 14px;
    color: #4a4860;
}

.sh-drawer__sub a.is-child {
    padding-left: 28px;
    font-size: 13.5px;
    color: var(--hm-muted);
}

.sh-drawer__logout {
    margin: auto 16px 20px;
}

.sh-drawer__logout button {
    width: 100%;
    padding: 12px;
    border: 1px solid #f5c2bc;
    border-radius: 12px;
    background: var(--hm-white);
    color: #b42318;
    font-weight: 600;
    cursor: pointer;
}

html.sh-lock,
html.sh-lock body {
    overflow: hidden;
}

/* ---------- Header responsive ---------- */

@media (max-width: 1199px) {
    .sh-nav > ul > li > a {
        padding: 10px 9px;
        font-size: 14.5px;
    }

    .sh-search {
        max-width: 260px;
    }
}

@media (max-width: 991px) {
    :root {
        --sh-top-h: 32px;
        --sh-main-h: 62px;
    }

    .sh-container {
        padding: 0 12px;
    }

    .sh-top {
        font-size: 12px;
    }

    .sh-top__inner {
        justify-content: center;
    }

    .sh-top__links {
        display: none;
    }

    .sh-main__inner {
        height: 62px;
        gap: 6px;
    }

    .sh-burger,
    .sh-search-toggle {
        display: inline-flex;
    }

    .sh-logo {
        margin-right: auto;
    }

    .sh-logo img {
        height: 40px;
    }

    .sh-nav,
    .sh-account,
    .sh-wish {
        display: none;
    }

    /* Search becomes a row under the bar, toggled by the icon */
    .sh-search {
        position: absolute;
        left: 12px;
        right: 12px;
        top: calc(100% + 8px);
        max-width: none;
        margin: 0;
        display: none;
    }

    .sh.is-search-open .sh-search {
        display: block;
    }

    .sh-search input {
        background: var(--hm-white);
        box-shadow: 0 16px 40px rgba(29, 27, 47, 0.18);
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.sf {
    background: #15121f;
    color: #c9c6d6;
    margin-top: 0;
    padding-top: 56px;
}

.sf-news {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 30px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--hm-primary), #7a52ec);
    color: var(--hm-white);
    margin-bottom: 48px;
}

.sf-news__text {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sf-news__icon {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.sf-news h2 {
    font-size: 21px;
    font-weight: 800;
    color: var(--hm-white);
}

.sf-news p {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 4px;
}

.sf-news__form {
    position: relative;
    display: flex;
    flex: 0 1 440px;
    background: var(--hm-white);
    border-radius: 999px;
    padding: 5px;
    margin: 0;
}

.sf-news__form input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0 18px;
    font-size: 15px;
    color: var(--hm-ink);
    background: transparent;
    height: 46px;
}

.sf-news__form input::placeholder {
    text-transform: none;
}

.sf-news__form button {
    border: 0;
    border-radius: 999px;
    background: var(--hm-ink);
    color: var(--hm-white);
    font-weight: 600;
    padding: 0 22px;
    cursor: pointer;
}

.sf-news__msg {
    position: absolute;
    left: 18px;
    top: calc(100% + 8px);
    font-size: 13px;
    font-weight: 500;
}

.sf-news__msg:empty {
    display: none;
}

.sf-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr) 1.3fr;
    gap: 32px;
    padding-bottom: 44px;
}

.sf-logo img {
    height: 64px;
    width: auto;
    margin-bottom: 16px;
}

.sf-brand p {
    font-size: 14px;
    line-height: 1.7;
    max-width: 320px;
}

.sf-social {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.sf-social a {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--hm-white) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.sf-social a:hover {
    background: var(--hm-primary);
}

.sf-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sf-col h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--hm-white);
    margin-bottom: 6px;
}

.sf-col a,
.sf-col span {
    font-size: 14px;
    color: #c9c6d6;
    transition: color 0.15s ease;
}

.sf-col a:hover {
    color: var(--hm-white);
}

.sf-contact a,
.sf-contact span {
    display: flex;
    gap: 10px;
    line-height: 1.5;
}

.sf-contact i {
    width: 16px;
    margin-top: 3px;
    color: #a98cf7;
}

.sf-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sf-bottom__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    padding-bottom: 18px;
    font-size: 13px;
}

.sf-pay {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    color: #c9c6d6;
}

.sf-pay span {
    font-size: 12.5px;
    margin-right: 4px;
}

.sf-pay span i {
    color: #19a35b;
    margin-right: 4px;
}

@media (max-width: 1199px) {
    .sf-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .sf-brand,
    .sf-contact {
        grid-column: span 3;
    }

    .sf-contact {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .sf {
        padding-top: 32px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .sf-container {
        padding: 0 16px;
    }

    .sf-news {
        flex-direction: column;
        align-items: stretch;
        padding: 22px;
        margin-bottom: 32px;
    }

    .sf-news__form {
        flex-basis: auto;
    }

    .sf-grid {
        grid-template-columns: 1fr 1fr;
        gap: 26px 18px;
    }

    .sf-brand {
        grid-column: 1 / -1;
    }

    .sf-contact {
        grid-column: 1 / -1;
    }

    .sf-bottom__inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sh *,
    .sh-drawer__panel,
    .sh-drawer__overlay {
        transition: none !important;
    }
}
