/* ========================================================================
   Petz Header Styles
   ======================================================================== */

.petz-header {
    background: var(--petz-bg-white);
    font-family: 'Inter', sans-serif;
    position: relative;
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* --- ROW 1: Top Bar (CTA, Logo, Auth) --- */
.petz-header-row-1 {
    padding: 12px 0;
    position: relative;
    background: #fff;
}

/* CTA Button — Petz brand green (primary) */
.petz-header-cta .btn-sell-now {
    background-color: var(--petz-primary) !important;
    color: #fff !important;
    border-radius: 8px !important;
    font-weight: 700;
    padding: 10px 20px;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.2);
    border: none !important;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.petz-header-cta .btn-sell-now i {
    margin-right: 6px;
    font-size: 16px;
}

.petz-header-cta .btn-sell-now:hover {
    background-color: #256b28 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(46, 125, 50, 0.3);
    color: #fff !important;
}

.petz-header-logo img {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

/* Auth / Language Nav */
.petz-header-auth .nav-link {
    color: var(--petz-text-dark);
    font-size: 14px;
    padding: 8px 12px !important;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.petz-header-auth .nav-link:hover {
    background: var(--petz-bg-page);
    color: var(--petz-primary);
}

.petz-header-auth .btn-outline-gray {
    border: 2px solid #e0e0e0;
    color: var(--petz-text-dark);
    border-radius: 6px;
    padding: 6px 16px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.petz-header-auth .btn-outline-gray:hover {
    border-color: var(--petz-primary);
    color: var(--petz-primary);
    background: transparent;
}

.image-profile-drop img {
    border-radius: 50%;
    margin-right: 8px;
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.message-notification {
    position: absolute;
    top: 0;
    left: 20px;
    background: var(--petz-accent-heart);
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
}

/* Hide Bootstrap caret on our custom dropdown triggers */
.petz-header-auth .dropdown-toggle::after {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
}

/* Flag sizes */
.petz-header-auth .flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
}

.petz-header-auth .language-dropdown .dropdown-item .flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    margin-right: 6px;
}

/* Desktop Wishlist Heart Icon — always red */
.petz-header-wishlist {
    padding: 8px 10px !important;
    color: var(--petz-accent-heart);
    transition: opacity 0.2s;
}

.petz-header-wishlist svg {
    display: block;
    stroke: var(--petz-accent-heart);
}

.petz-header-wishlist:hover {
    opacity: 0.7;
}

/* --- ROW 2: Nav Bar (Desktop) --- */
.petz-header-row-2 {
    background: #fff;
    border-top: 1px solid var(--petz-border);
    border-bottom: 1px solid var(--petz-border);
}

.petz-header-row-2 > .container > .d-flex,
.petz-header-row-2 > .container-fluid > .d-flex {
    height: 54px;
}

/* Hamburger */
.petz-hamburger-btn {
    background: transparent;
    border: none;
    color: var(--petz-text-dark);
    padding: 0 20px 0 0;
    cursor: pointer;
    transition: color 0.2s;
    height: 100%;
    border-radius: 0;
    white-space: nowrap;
}

.petz-hamburger-btn:hover {
    color: var(--petz-primary);
}

.petz-hamburger-btn span {
    font-size: 14px;
    letter-spacing: 0.5px;
}

.petz-hamburger-btn i {
    color: var(--petz-text-dark);
}

.petz-hamburger-btn:hover i {
    color: var(--petz-primary);
}

/* ------ Center Nav (Categories) ------ */
/* Override the inner .container from _nav_main.php to be fluid */
.petz-header-nav-main .container {
    max-width: 100%;
    padding: 0;
}

/* Center the category bar items */
.petz-header-nav-main .navbar {
    padding: 0;
    justify-content: center;
}

.petz-header-nav-main .mega-menu {
    justify-content: center !important;
}

.petz-header-nav-main .navbar-nav > li > a,
.petz-header-nav-main .mega-menu > .nav-item > a {
    color: var(--petz-text-dark) !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    text-transform: uppercase;
    padding: 16px 18px !important;
    position: relative;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    line-height: 22px !important;
    white-space: nowrap;
}

.petz-header-nav-main .mega-menu > .nav-item:hover > a {
    color: var(--petz-primary) !important;
    border-bottom-color: var(--petz-primary) !important;
    background-color: transparent !important;
}

.petz-header-nav-main .scroll-btn {
    display: none !important; /* Hide scroll buttons — we have enough space */
}

/* Mega menu dropdown positioning override */
.petz-header-nav-main .dropdown-menu.mega-menu-content {
    border-top: 1px solid var(--petz-border);
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Secondary Nav */
.petz-header-nav-secondary .nav-link {
    color: var(--petz-text-dark);
    font-size: 13px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.petz-header-nav-secondary .nav-link:hover {
    color: var(--petz-primary);
}

/* ========================================================================
   SLIDE-IN DRAWER (works on ALL breakpoints) — Push-page + Cascade-in
   ======================================================================== */

/*
 * FIX: Modesy core (style-2.6.css:10354) hides .nav-mobile and .overlay-bg
 * on ≥992px with display:none!important. We override with higher specificity
 * using an ID selector so the drawer works on desktop too.
 */
@media (min-width: 992px) {
    #navMobile.nav-mobile {
        display: block !important;
    }
    /* Overlay stays hidden by default on desktop (Modesy hides it).
       We show it ONLY when drawer is open via body.drawer-open class */
    body.drawer-open #overlay_bg.overlay-bg {
        display: block !important;
    }
}

.nav-mobile {
    top: 0 !important;
    height: 100vh !important;
    z-index: 10010 !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-mobile-open {
    width: 320px !important;
}

.nav-mobile-open .nav-mobile-inner {
    width: 320px !important;
}

.overlay-bg {
    z-index: 10005 !important;
}

/* ---------- Push-page effect: desktop only ---------- */
/* Mobile: drawer overlays on top (no push). Desktop: body shifts right. */
@media (min-width: 992px) {
    body {
        transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.drawer-open {
        margin-left: 320px;
        overflow-x: hidden;
    }
}

/* Overlay dims the background content */
body.drawer-open .overlay-bg {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* The drawer itself stays fixed at viewport left edge */
.nav-mobile {
    position: fixed !important;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ---------- Cascade-in animation for drawer items ---------- */
@keyframes drawerItemIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User card fades in */
.nav-mobile-open .petz-drawer-user-card {
    animation: drawerItemIn 0.3s ease-out both;
}

/* Category & menu items cascade in with stagger */
.nav-mobile-open .nav-item {
    opacity: 0;
    animation: drawerItemIn 0.3s ease-out both;
}

.nav-mobile-open .nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-mobile-open .nav-item:nth-child(2) { animation-delay: 0.10s; }
.nav-mobile-open .nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-mobile-open .nav-item:nth-child(4) { animation-delay: 0.20s; }
.nav-mobile-open .nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-mobile-open .nav-item:nth-child(6) { animation-delay: 0.30s; }
.nav-mobile-open .nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-mobile-open .nav-item:nth-child(8) { animation-delay: 0.40s; }
.nav-mobile-open .nav-item:nth-child(9) { animation-delay: 0.45s; }
.nav-mobile-open .nav-item:nth-child(10) { animation-delay: 0.50s; }

/* Section labels ("ΚΑΤΗΓΟΡΙΕΣ", "ΜΕΝΟΥ") also cascade */
.nav-mobile-open .font-600.text-uppercase {
    opacity: 0;
    animation: drawerItemIn 0.25s ease-out 0.02s both;
}

/* Reduce excess bottom padding (language picker was removed) */
.nav-mobile .nav-mobile-inner {
    padding-bottom: 20px !important;
}

/* Desktop only: compensate for scrollbar width in drawer */
@media (min-width: 992px) {
    .nav-mobile .nav-mobile-inner {
        padding-right: calc(var(--scrollbar-w, 17px) * 2);
    }
}

.nav-mobile .navbar-nav {
    padding-bottom: 10px !important;
}

/* ========================================================================
   DRAWER — User Card
   ======================================================================== */

.petz-drawer-user-card {
    background: #012604 url('/assets/img/petz-drawer-bg.svg') center center / 100% 100% no-repeat;
    padding: 28px 24px 24px;
    text-align: center;
    position: relative;
    /* Bleed past .nav-mobile-inner padding (20px) for full width */
    margin: -20px -20px 15px -20px;
    border-radius: 0;
    overflow: hidden;
}

/* Dark overlay to deepen the SVG background */
.petz-drawer-user-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 15, 0, 0.35);
    pointer-events: none;
    z-index: 0;
}

/* Ensure all user card content sits above the overlay */
.petz-drawer-user-card > * {
    position: relative;
    z-index: 1;
}

.petz-drawer-close {
    position: absolute;
    top: 8px;
    right: 16px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.petz-drawer-close:hover {
    color: #fff;
}

.petz-drawer-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.25);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.petz-drawer-avatar-link {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.2s;
}

.petz-drawer-avatar-link:hover {
    opacity: 0.85;
}

a.petz-drawer-greeting {
    text-decoration: none !important;
    color: #fff !important;
    transition: opacity 0.2s;
}

a.petz-drawer-greeting:hover {
    opacity: 0.8;
    color: #fff !important;
}

.petz-drawer-guest-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    border: 3px solid rgba(255,255,255,0.15);
}

.petz-drawer-greeting {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Logged-in quick links */
.petz-drawer-user-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.petz-drawer-user-links a {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.petz-drawer-user-links a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}

.petz-drawer-badge {
    background: var(--petz-accent-heart);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    padding: 1px 6px;
    font-weight: 700;
    line-height: 14px;
}

/* Guest auth buttons */
.petz-drawer-auth-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.petz-drawer-btn-signup,
.petz-drawer-btn-login {
    padding: 8px 22px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.petz-drawer-btn-signup {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff;
}

.petz-drawer-btn-signup:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    color: #fff;
}

.petz-drawer-btn-login {
    background: var(--petz-primary);
    border: 2px solid var(--petz-primary);
    color: #fff;
}

.petz-drawer-btn-login:hover {
    background: var(--petz-primary-dark);
    border-color: var(--petz-primary-dark);
}

/* ========================================================================
   MOBILE TOP HEADER BAR — 5-icon layout
   ======================================================================== */

.petz-mobile-header {
    background: #fff;
    border-bottom: 1px solid var(--petz-border);
    position: relative;
    z-index: 1040;
}

.petz-mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 8px;
}

.petz-mobile-left,
.petz-mobile-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.petz-mobile-logo {
    flex-shrink: 0;
}

.petz-mobile-logo img {
    display: block;
    max-height: 34px;
    width: auto;
}

/* Base icon button — 44×44 min tap target (Apple HIG) */
.petz-mobile-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--petz-text-dark);
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none !important;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.petz-mobile-icon-btn i {
    font-size: 22px;
}

/* Uniform SVG sizing for all icons */
.petz-mobile-icon-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.petz-mobile-icon-btn:hover,
.petz-mobile-icon-btn:active {
    background: var(--petz-bg-page);
    color: var(--petz-primary);
}

/* Heart icon — always red in mobile header */
.petz-mobile-right a[href*="wishlist"] {
    color: var(--petz-accent-heart) !important;
}

.petz-mobile-right a[href*="wishlist"] svg {
    stroke: var(--petz-accent-heart);
}

/* Add (+) button — flat green icon, no box background */
.petz-mobile-add-btn {
    color: var(--petz-primary) !important;
    background: transparent !important;
    box-shadow: none;
}

.petz-mobile-add-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--petz-primary);
    stroke-width: 2.5;
}

.petz-mobile-add-btn:hover,
.petz-mobile-add-btn:active {
    background: var(--petz-bg-page) !important;
    color: var(--petz-primary-dark, #256b28) !important;
}
/* ========================================================================
   CATEGORY SVG ICON — reusable sizing
   ======================================================================== */

/* Drawer (mobile) — small inline icons */
.petz-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-right: 10px;
    vertical-align: middle;
}

.petz-cat-icon svg {
    width: 22px !important;
    height: 22px !important;
    display: block;
}

/* Arrow icon in Help & Guides section — match Modesy's category arrow style */
#hc-main-list .nav-link i,
#hc-subcats-list .nav-link i {
    float: right;
}

/* ========================================================================
   DESKTOP MEGA MENU — Grid with SVG icons
   ======================================================================== */

.petz-mega-dropdown {
    border: none !important;
    border-top: 3px solid var(--petz-primary) !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12) !important;
    padding: 28px 36px !important;
    width: 100vw !important;
    max-width: 1320px;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

.petz-mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 24px;
}

.petz-mega-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 12px;
    text-decoration: none !important;
    color: var(--petz-text-dark) !important;
    transition: background 0.2s, transform 0.15s;
}

.petz-mega-item:hover {
    background: var(--petz-bg-page);
    transform: translateX(4px);
    color: var(--petz-primary) !important;
}

/* Large icon container for mega menu */
.petz-mega-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--petz-bg-page);
    padding: 6px;
    transition: background 0.2s;
}

.petz-mega-item:hover .petz-mega-icon {
    background: rgba(46, 125, 50, 0.08);
}

.petz-mega-icon svg {
    width: 40px !important;
    height: 40px !important;
    display: block;
}

/* Text container */
.petz-mega-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--petz-text-dark);
}

.petz-mega-item:hover .petz-mega-label {
    color: var(--petz-primary);
}

/* Short description via ::after — use grid for proper alignment under label */
.petz-mega-item[data-desc] {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 16px;
    align-items: center;
}

/* Icon spans both rows */
.petz-mega-item[data-desc] .petz-mega-icon {
    grid-row: 1 / 3;
}

.petz-mega-item[data-desc]::after {
    content: attr(data-desc);
    grid-column: 2;
    font-size: 12px;
    font-weight: 400;
    color: var(--petz-text-muted, #888);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================================================
   SECONDARY NAV — Help Center / Pet Guide Dropdowns
   ======================================================================== */

.petz-secondary-dropdown {
    position: relative;
}

/* Green underline indicator on hover — match category nav items */
.petz-secondary-dropdown > .nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--petz-primary, #2E7D32);
    transition: width 0.25s ease, left 0.25s ease;
    border-radius: 2px;
}

.petz-secondary-dropdown:hover > .nav-link::before {
    width: 100%;
    left: 0;
}

/* Show dropdown on hover (not click) */
.petz-secondary-dropdown:hover > .dropdown-menu {
    display: block;
    animation: petzDropIn 0.2s ease;
}

@keyframes petzDropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.petz-secondary-dropdown .dropdown-toggle::after {
    display: none; /* Hide Bootstrap caret */
}

.petz-secondary-mega {
    min-width: 300px;
    padding: 16px 10px;
    border: none;
    border-top: 3px solid var(--petz-primary, #2E7D32);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    /* Center below the link */
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    margin-top: 2px;
}

.petz-secondary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--petz-text-dark, #1a1a2e);
    transition: background 0.15s, transform 0.15s;
}

.petz-secondary-item:hover {
    background: var(--petz-bg-page, #f5f6fa);
    transform: translateX(2px);
    text-decoration: none;
    color: var(--petz-primary, #2E7D32);
}

.petz-secondary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.petz-secondary-icon svg {
    width: 28px !important;
    height: 28px !important;
    display: block;
}

.petz-secondary-label {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

/* ========================================================================
   RESPONSIVE OVERRIDES
   ======================================================================== */

@media (max-width: 991px) {
    .petz-header-row-1 {
        padding: 8px 0;
    }
    .petz-header-logo img {
        max-height: 36px;
    }
    .petz-header-cta .btn-sell-now {
        padding: 6px 12px;
        font-size: 12px;
    }
    .petz-header-cta .btn-sell-now span {
        display: none !important;
    }
    .petz-header-cta .btn-sell-now i {
        margin-right: 0;
    }
}
