/* ============================================================
   GADGET5 MASTER STYLESHEET (v3.2 - Clean, Modern & Soothing)
   Brand Color System:
     --g5-white    #FAFCFD (Soft Porcelain White - Zero Glare)
     --g5-bg       #F1F6F9 (Mild Ice Surface for Inputs/Cards)
     --g5-teal     #137A7F (Deep Velvet Marine Teal - Actions)
     --g5-text     #243C3C (Refined Slate Charcoal - 100% Legible)
     --g5-gold     #E5B842 (Champagne Satin Gold - Badges)
   ============================================================ */

:root {
    --g5-white: #FAFCFD;
    --g5-bg: #F1F6F9;
    --g5-teal: #137A7F;
    --g5-teal-dark: #0D5C60;
    --g5-text: #243C3C;
    --g5-gold: #E5B842;
}

.g5-header {
    position: relative;
    width: 100%;
    z-index: 999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--g5-white);
    border-bottom: 1px solid rgba(36, 60, 60, 0.06);
}

/* ===================== SECTION 1: TOP BAR ===================== */
.g5-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px;
    box-sizing: border-box;
    background: var(--g5-white);
}

.g5-topbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.g5-topbar-logo a {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    text-decoration: none;
}

.g5-topbar-logo img {
    display: block;
    height: 40px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.g5-topbar-logo a:hover img {
    transform: scale(1.02);
}

/* 1.2 Search Bar */
.g5-topbar-search {
    display: none;
    flex: 1 1 auto;
    max-width: 480px;
    margin: 0 auto;
    box-sizing: border-box;
}

.g5-search-wrap {
    position: relative;
    width: 100%;
}

.g5-search-wrap form {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100%;
    box-sizing: border-box;
    background: var(--g5-bg) !important;
    border: 1.5px solid var(--g5-teal) !important;
    border-radius: 999px !important;
    padding: 3px !important;
    margin: 0 !important;
    transition: box-shadow 0.25s ease;
}

.g5-search-wrap form:focus-within {
    box-shadow: 0 0 0 4px rgba(19, 122, 127, 0.16);
}

.g5-search-wrap input[type="search"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px !important;
    flex: 1 1 auto !important;
    width: 100%;
    height: 38px !important;
    margin: 0 !important;
    padding: 0 0 0 16px !important;
    color: var(--g5-text) !important;
    border-radius: 999px !important;
}

.g5-search-wrap input[type="search"]::placeholder {
    color: rgba(36, 60, 60, 0.55);
}

.g5-search-wrap button {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: none !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: var(--g5-teal) !important;
    flex-shrink: 0 !important;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.g5-search-wrap button:hover {
    background: var(--g5-teal-dark) !important;
    transform: scale(1.04);
}

.g5-search-wrap svg {
    width: 15px !important;
    height: 15px !important;
    fill: #FFFFFF !important;
    display: block;
}

/* 1.3 Desktop Utility Icons */
.g5-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.g5-utility {
    display: none !important;
    align-items: center;
    gap: 10px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.g5-utility li {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

.g5-utility li a {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    color: var(--g5-text) !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease !important;
}

.g5-utility li a:hover {
    background-color: var(--g5-bg) !important;
    color: var(--g5-teal) !important;
    transform: translateY(-2px);
}

.g5-utility svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    fill: var(--g5-text);
    transition: fill 0.2s ease;
}

.g5-utility li a:hover svg {
    fill: var(--g5-teal);
}

.g5-utility .g5-head-wish svg {
    fill: transparent !important;
    stroke: var(--g5-text) !important;
    stroke-width: 2 !important;
}

.g5-utility .g5-head-wish:hover svg {
    stroke: var(--g5-teal) !important;
}

/* Luxury iOS-Style Badges */
.g5-badge,
.g5-wish-count {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    background: var(--g5-gold) !important;
    color: var(--g5-text) !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    min-width: 17px !important;
    height: 17px !important;
    padding: 0 4px !important;
    border-radius: 999px !important;
    border: 2px solid var(--g5-white) !important;
    box-shadow: 0 2px 4px rgba(36, 60, 60, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
    z-index: 10 !important;
    line-height: 1 !important;
}

.g5-wish-count[hidden] {
    display: none !important;
}

/* Tooltips */
.g5-tip { position: relative; }
.g5-tip::after {
    content: attr(data-tip);
    position: absolute; top: 100%; left: 50%;
    margin-top: 10px;
    transform: translateX(-50%) translateY(-4px);
    background: var(--g5-text);
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 70;
}
.g5-tip::before {
    content: "";
    position: absolute; top: 100%; left: 50%;
    margin-top: 4px;
    transform: translateX(-50%) translateY(-4px);
    border: 5px solid transparent;
    border-bottom-color: var(--g5-text);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 70;
}
.g5-tip:hover::after, .g5-tip:focus-visible::after,
.g5-tip:hover::before, .g5-tip:focus-visible::before {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

/* Hamburger */
.g5-chk { position: absolute !important; opacity: 0 !important; pointer-events: none !important; width: 0 !important; height: 0 !important; }
.g5-ham {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    cursor: pointer;
}
.g5-ham span {
    display: block;
    height: 2.5px;
    width: 24px;
    background: var(--g5-text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.g5-chk:checked ~ .g5-topbar .g5-ham span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.g5-chk:checked ~ .g5-topbar .g5-ham span:nth-child(2) { opacity: 0; }
.g5-chk:checked ~ .g5-topbar .g5-ham span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===================== SECTION 2: DESKTOP NAV STRIP ===================== */
.g5-navbar-strip {
    width: 100%;
    display: none;
    background-color: var(--g5-text);
    background-image: linear-gradient(
        115deg,
        var(--g5-text) 0%,
        var(--g5-text) 42%,
        rgba(255, 255, 255, 0.16) 50%,
        var(--g5-text) 58%,
        var(--g5-text) 100%
    );
    background-size: 260% 100%;
    background-repeat: no-repeat;
    animation: g5-navshine 7s ease-in-out infinite;
}

@keyframes g5-navshine {
    0% { background-position: 140% 0; }
    50% { background-position: -40% 0; }
    100% { background-position: -40% 0; }
}

.g5-navbar-strip-inner {
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex !important;
    justify-content: center !important;
    box-sizing: border-box;
}

.g5-navbar { display: flex !important; justify-content: center !important; width: auto !important; }
.g5-nav-list {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 6px;
    gap: 4px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.g5-nav-list > li { display: list-item !important; position: relative; }
.g5-nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 13px 16px;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.25s ease;
}
.g5-nav-list > li > a:hover,
.g5-nav-list > li > a:focus-visible,
.g5-nav-list > li.g5-active > a { color: var(--g5-gold); }

.g5-drop-arrow {
    display: inline-block;
    width: 8px; height: 8px;
    border-right: 2px solid #FFFFFF;
    border-bottom: 2px solid #FFFFFF;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}
.g5-nav-list > li > a:hover .g5-drop-arrow,
.g5-nav-list > li.g5-dropdown-open > a .g5-drop-arrow { border-color: var(--g5-gold); }
.g5-nav-list > li.g5-dropdown-open > a .g5-drop-arrow { transform: rotate(225deg); margin-top: 3px; }

/* Submenu Dropdown */
.g5-dropdown {
    position: absolute; top: 100%; left: 0; min-width: 230px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(36, 60, 60, 0.16);
    padding: 8px 0; list-style: none !important; margin: 0;
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 50;
}
.g5-has-dropdown:hover > .g5-dropdown,
.g5-has-dropdown:focus-within > .g5-dropdown,
.g5-has-dropdown.g5-dropdown-open > .g5-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.g5-dropdown li a {
    display: block; padding: 10px 16px; font-size: 13.5px; font-weight: 500;
    color: var(--g5-text); text-decoration: none; white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}
.g5-dropdown li a:hover,
.g5-dropdown li a:focus-visible { background: var(--g5-bg); color: var(--g5-teal); }

/* ===================== SECTION 3: MOBILE DRAWER ===================== */
.g5-mobile-drawer {
    position: fixed; top: 0; bottom: 0; right: -100%;
    width: 85%; max-width: 340px;
    background: var(--g5-white);
    box-shadow: -6px 0 24px rgba(36, 60, 60, 0.18);
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px 0 100px;
}
.g5-chk:checked ~ .g5-mobile-drawer { right: 0; }
.g5-mob-overlay {
    position: fixed; inset: 0;
    background: rgba(36, 60, 60, 0.45);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
}
.g5-chk:checked ~ .g5-mob-overlay { opacity: 1; visibility: visible; }

.g5-mob-search { padding: 0 20px 16px; }

.g5-mob-track {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin: 0 20px 16px; padding: 13px 16px;
    border-radius: 12px;
    color: #FFFFFF; font-weight: 600; font-size: 14px;
    text-decoration: none; position: relative; overflow: hidden;
    background: linear-gradient(135deg, #137A7F 0%, #0E6064 100%);
    box-shadow: 0 4px 12px rgba(19, 122, 127, 0.25);
    text-align: center;
}
.g5-mob-track svg { width: 18px !important; height: 18px !important; fill: #FFFFFF !important; }

.g5-mob-list { list-style: none !important; margin: 0 !important; padding: 0 !important; border-top: 1px solid rgba(36, 60, 60, 0.06); }
.g5-mob-list > li { border-bottom: 1px solid rgba(36, 60, 60, 0.06); list-style: none !important; }
.g5-mob-list > li > a {
    display: block; padding: 16px 20px; font-size: 15px; font-weight: 600;
    color: var(--g5-text); text-decoration: none;
}
.g5-mob-list > li > a:active { color: var(--g5-teal); background: rgba(19, 122, 127, 0.04); }

.g5-mob-list details { border-bottom: 1px solid rgba(36, 60, 60, 0.06); }
.g5-mob-list details summary {
    list-style: none !important; display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; font-size: 15px; font-weight: 600; color: var(--g5-text);
    cursor: pointer;
}
.g5-mob-list details summary::-webkit-details-marker { display: none; }
.g5-mob-list details summary::after {
    content: "+"; font-size: 18px; font-weight: 500; color: var(--g5-teal);
    transition: transform 0.2s ease;
}
.g5-mob-list details[open] summary::after { content: "–"; }
.g5-mob-list details .g5-mob-sub {
    list-style: none !important; margin: 0; padding: 0 0 10px 0; background: var(--g5-bg);
}
.g5-mob-list details .g5-mob-sub li a {
    display: block; padding: 12px 20px 12px 34px; font-size: 14px; font-weight: 500;
    color: var(--g5-text); text-decoration: none;
}
.g5-mob-list details .g5-mob-sub li a:active { color: var(--g5-teal); }

.g5-mob-utility {
    list-style: none !important; margin: 14px 0 0 !important; padding: 0 !important;
    border-top: 6px solid var(--g5-bg);
}
.g5-mob-utility li a {
    display: flex; align-items: center; gap: 10px; padding: 14px 20px;
    font-size: 15px; font-weight: 500; color: var(--g5-text); text-decoration: none;
    border-bottom: 1px solid rgba(36, 60, 60, 0.06);
}
.g5-mob-utility svg { width: 19px !important; height: 19px !important; fill: var(--g5-text) !important; }

/* ===================== SECTION 4: MOBILE BOTTOM NAV ===================== */
.g5-bottom-nav {
    display: flex !important;
    position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--g5-white);
    border-top: 1px solid var(--g5-bg);
    box-shadow: 0 -4px 14px rgba(36, 60, 60, 0.1);
    z-index: 900;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    overflow: hidden;
}
.g5-bottom-nav a,
.g5-bottom-nav label {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--g5-text); text-decoration: none; font-size: 10.5px; font-weight: 600;
    padding: 4px 0; position: relative; z-index: 1; cursor: pointer; min-height: 44px;
}
.g5-bottom-nav svg { width: 21px !important; height: 21px !important; fill: var(--g5-text); }
.g5-bottom-nav a.g5-active, .g5-bottom-nav a:active { color: var(--g5-teal); }
.g5-bottom-nav a.g5-active svg, .g5-bottom-nav a:active svg { fill: var(--g5-teal); }
.g5-bottom-badge {
    position: absolute; top: 2px; right: 14px;
    background: var(--g5-gold); color: var(--g5-text);
    font-size: 9px; font-weight: 800; border-radius: 50%;
    min-width: 15px; height: 15px;
    display: flex; align-items: center; justify-content: center; padding: 2px;
}

body { padding-bottom: 64px; }

/* ===================== SECTION 5: LIVE SEARCH DROPDOWN ===================== */
.g5-search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: #FFFFFF;
    border: 1px solid #E3EEF2;
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(36, 60, 60, 0.16);
    max-height: 400px;
    overflow-y: auto;
    z-index: 200;
    display: none;
    padding: 6px;
}
.g5-search-results.g5-open { display: block; }
.g5-search-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: 10px; text-decoration: none;
    transition: background 0.15s ease;
}
.g5-search-item:hover, .g5-search-item.g5-active { background: var(--g5-bg); }
.g5-search-item img {
    width: 42px; height: 42px; object-fit: cover;
    border-radius: 8px; background: var(--g5-bg); flex-shrink: 0;
}
.g5-search-item-info { min-width: 0; flex: 1; }
.g5-search-item-title {
    font-size: 13.5px; font-weight: 600; color: var(--g5-text);
    margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.g5-search-item-price { font-size: 12.5px; color: var(--g5-teal); font-weight: 700; }
.g5-search-item-price del { color: #8FADAD; font-weight: 400; margin-right: 4px; }
.g5-search-empty, .g5-search-loading { padding: 16px; text-align: center; font-size: 13px; color: #5C7A7A; }
.g5-search-viewall {
    display: block; text-align: center; padding: 10px; margin-top: 4px;
    border-top: 1px solid var(--g5-bg); font-size: 12.5px; font-weight: 700;
    color: var(--g5-teal); text-decoration: none;
}
.g5-search-viewall:hover { color: var(--g5-text); }

/* ===================== SECTION 6: RESPONSIVE BREAKPOINTS ===================== */
@media (min-width: 600px) {
    .g5-topbar-search { display: block; }
}

@media (min-width: 960px) {
    .g5-topbar {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        align-items: center !important;
        padding: 14px 30px;
    }
    .g5-topbar-search { margin: 0 auto !important; width: 480px !important; }
    .g5-topbar-right { justify-content: flex-end !important; }
    .g5-utility { display: flex !important; }
    .g5-ham, .g5-mobile-drawer, .g5-mob-overlay, .g5-bottom-nav { display: none !important; }
    .g5-navbar-strip { display: block; }
    body { padding-bottom: 0; }
}