/* ==========================================================
   PATCHESWHOLESALE PREMIUM HEADER
   File: pw_premium_header.css
   Compatible with OpenCart 3.x default Bootstrap structure
   All custom styling uses pw-specific selectors.
   ========================================================== */

/* ---------- TOP ANNOUNCEMENT BAR ---------- */

.pw-topbar {
    background: #171717;
    color: #ffffff;
    border-bottom: 1px solid #b99a60;
    font-size: 11px;
    position: relative;
    z-index: 1002;
}

.pw-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 40px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.pw-topbar-announcement {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    line-height: 1.6;
}

.pw-topbar-announcement > .fa-truck {
    color: #d9b36c;
    font-size: 14px;
    margin-right: 3px;
}

.pw-topbar-separator {
    color: #b99a60;
}

.pw-topbar-announcement .pw-shipping-link {
    color: #e4c68e;
    font-weight: 700;
    text-decoration: none;
}

.pw-topbar-announcement .pw-shipping-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.pw-topbar-links {
    flex-shrink: 0;
}

.pw-topbar-links .list-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0;
    margin: 0;
}

.pw-topbar-links .list-inline > li {
    padding: 0;
    margin: 0;
    position: relative;
}

.pw-topbar-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #eeeeee;
    text-decoration: none;
    transition: color .2s ease;
}

.pw-topbar-links a:hover,
.pw-topbar-links li.open > a {
    color: #dfc28b;
}

.pw-topbar-links a > .fa {
    font-size: 12px;
}

.pw-small-chevron {
    font-size: 10px !important;
}

.pw-topbar-links .dropdown-menu {
    min-width: 175px;
    margin-top: 9px;
    padding: 7px 0;
    background: #ffffff;
    border: 1px solid #e9e4da;
    border-radius: 3px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
}

.pw-topbar-links .dropdown-menu > li > a {
    display: block;
    padding: 9px 15px;
    color: #333333;
}

.pw-topbar-links .dropdown-menu > li > a:hover {
    color: #98783f;
    background: #faf8f4;
}

/* ---------- MAIN HEADER ---------- */

.pw-header-main {
    position: relative;
    z-index: 1001;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
}

.pw-header-main > .container {
    padding-top: 21px;
    padding-bottom: 21px;
}

.pw-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.pw-header-row > .pw-logo-column,
.pw-header-row > .pw-search-column,
.pw-header-row > .pw-cart-column {
    float: none;
}

.pw-header-main #logo {
    display: flex;
    align-items: center;
    min-height: 48px;
}

.pw-header-main #logo a {
    color: #171717;
    text-decoration: none;
}

.pw-header-main #logo img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 72px;
}

.pw-header-main #logo h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.3;
}

.pw-header-main .pw-search-wrapper {
    width: 100%;
}

.pw-header-main .pw-search-wrapper > * {
    max-width: 100%;
}

.pw-header-main .pw-search-wrapper input {
    box-shadow: none;
}

.pw-header-main .pw-search-wrapper input:focus {
    border-color: #b99a60;
    outline: none;
    box-shadow: 0 0 0 2px rgba(185, 154, 96, .12);
}

.pw-header-main .pw-cart-wrapper {
    width: 100%;
}

/* ---------- CATEGORY NAVIGATION ---------- */

.pw-menu-shell {
    position: relative;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid #e6e2d9;
}

.pw-menu-shell #menu.pw-category-nav {
    min-height: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.pw-menu-shell #menu .navbar-nav > li > a {
    padding: 17px 14px;
    color: #252525;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .45px;
    line-height: 20px;
    text-transform: uppercase;
    transition: color .2s ease, background-color .2s ease;
}

.pw-menu-shell #menu .navbar-nav > li > a:hover,
.pw-menu-shell #menu .navbar-nav > li > a:focus,
.pw-menu-shell #menu .navbar-nav > li.open > a {
    color: #98783f;
    background: #faf8f4;
}

.pw-menu-shell #menu .pw-category-chevron {
    margin-left: 5px;
    color: #9d865a;
    font-size: 12px;
}

.pw-menu-shell #menu .dropdown-menu {
    display: none;
    min-width: 220px;
    padding: 8px 0;
    margin-top: 0;
    background: #ffffff;
    border: 1px solid #e8e1d5;
    border-top: 2px solid #b99a60;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .09);
}

.pw-menu-shell #menu li.dropdown.open > .dropdown-menu {
    display: block;
}

.pw-menu-shell #menu .dropdown-inner {
    display: flex;
    align-items: flex-start;
}

.pw-menu-shell #menu .dropdown-inner ul {
    min-width: 180px;
    padding: 0;
    margin: 0;
}

.pw-menu-shell #menu .dropdown-inner li a {
    display: block;
    padding: 9px 16px;
    color: #333333;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease;
}

.pw-menu-shell #menu .dropdown-inner li a:hover {
    color: #98783f;
    background: #faf8f4;
}

.pw-menu-shell #menu .see-all {
    display: block;
    padding: 11px 16px;
    margin-top: 5px;
    color: #222222;
    background: #faf9f6;
    border-top: 1px solid #ece7dd;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.pw-menu-shell #menu .see-all:hover {
    color: #98783f;
}

.pw-menu-shell #menu .see-all > .fa {
    margin-left: 5px;
}

.pw-menu-shell #menu .pw-mobile-menu-label {
    display: none;
}

/* ---------- TABLET ---------- */

@media (min-width: 768px) and (max-width: 991px) {
    .pw-topbar-inner {
        gap: 10px;
    }

    .pw-topbar-announcement {
        font-size: 10px;
        gap: 5px;
    }

    .pw-topbar-links .list-inline {
        gap: 10px;
    }

    .pw-topbar-label {
        display: none;
    }

    .pw-header-main > .container {
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .pw-menu-shell #menu .navbar-nav > li > a {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 10px;
        letter-spacing: .2px;
    }

    .pw-menu-shell #menu .pw-category-chevron {
        margin-left: 2px;
    }
}

/* ---------- MOBILE ---------- */

@media (max-width: 767px) {
    .pw-topbar-inner {
        display: block;
        min-height: 0;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .pw-topbar-announcement {
        justify-content: center;
        text-align: center;
        gap: 4px 6px;
        font-size: 10px;
    }

    .pw-topbar-announcement > .fa-truck {
        font-size: 12px;
    }

    .pw-international-separator,
    .pw-international-text {
        display: none;
    }

    .pw-topbar-links {
        display: none;
    }

    .pw-header-main > .container {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    .pw-header-row {
        display: block;
    }

    .pw-header-row > .pw-logo-column,
    .pw-header-row > .pw-search-column,
    .pw-header-row > .pw-cart-column {
        width: 100%;
    }

    .pw-header-main #logo {
        justify-content: center;
        margin-bottom: 14px;
    }

    .pw-header-main #logo img {
        max-height: 58px;
    }

    .pw-header-main #logo h1 {
        font-size: 22px;
    }

    .pw-header-main .pw-search-wrapper {
        margin-bottom: 12px;
    }

    .pw-header-main .pw-cart-wrapper {
        margin-top: 5px;
    }

    .pw-menu-shell #menu .navbar-header {
        min-height: 44px;
    }

    .pw-menu-shell #menu #category {
        display: inline-block;
        padding: 12px 0;
        color: #222222;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .5px;
        text-transform: uppercase;
    }

    .pw-menu-shell #menu .navbar-toggle {
        display: block;
        float: right;
        margin: 5px 0;
        padding: 8px 10px;
        color: #222222;
        background: #ffffff;
        border: 1px solid #ded8cc;
        border-radius: 3px;
    }

    .pw-menu-shell #menu .navbar-toggle:hover,
    .pw-menu-shell #menu .navbar-toggle:focus {
        color: #98783f;
        background: #faf8f4;
    }

    .pw-menu-shell #menu .pw-mobile-menu-label {
        display: inline;
        margin-left: 4px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .pw-menu-shell #menu .navbar-collapse {
        padding-right: 0;
        padding-left: 0;
        border-top: 1px solid #eee9df;
        box-shadow: none;
    }

    .pw-menu-shell #menu .navbar-nav {
        margin: 0;
    }

    .pw-menu-shell #menu .navbar-nav > li > a {
        padding: 12px 10px;
        border-bottom: 1px solid #f0eee9;
        font-size: 11px;
    }

    /* Keep mobile subcategories closed until their parent is opened */
    .pw-menu-shell #menu .dropdown-menu {
        position: static;
        float: none;
        display: none;
        width: 100%;
        min-width: 0;
        padding: 0;
        margin: 0;
        border: 0;
        border-top: 1px solid #eee9df;
        border-radius: 0;
        box-shadow: none;
    }

    .pw-menu-shell #menu li.dropdown.open > .dropdown-menu {
        display: block;
    }

    .pw-menu-shell #menu .dropdown-inner {
        display: block;
    }

    .pw-menu-shell #menu .dropdown-inner ul {
        width: 100%;
        min-width: 0;
    }

    .pw-menu-shell #menu .dropdown-inner li a {
        padding: 10px 25px;
        background: #faf9f6;
        border-bottom: 1px solid #efede8;
    }

    .pw-menu-shell #menu .see-all {
        padding-left: 25px;
    }
}

/* ---------- REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
    .pw-topbar-announcement a,
    .pw-topbar-links a,
    .pw-menu-shell #menu .navbar-nav > li > a,
    .pw-menu-shell #menu .dropdown-inner li a {
        transition: none;
    }
}

/* ==========================================================
   MOBILE JOURNAL-INSPIRED HEADER + SLIDE-IN DRAWER
   Desktop header/navigation styles above remain unchanged.
   ========================================================== */

/* Desktop hides mobile-only controls */
.pw-mobile-header {
    display: none;
}

.pw-mobile-search-row {
    display: none;
}

/* Mobile utility links, without language/currency */
.pw-mobile-utility {
    display: none;
}

/* Drawer backdrop */
.pw-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 10090;
    display: block;
    background: rgba(0, 0, 0, .58);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.pw-mobile-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Drawer panel */
.pw-mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10091;
    display: flex;
    flex-direction: column;
    width: min(88vw, 370px);
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    color: #222;
    background: #fff;
    box-shadow: 8px 0 28px rgba(0, 0, 0, .22);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .28s ease, visibility .28s ease;
}

.pw-mobile-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.pw-mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 10px 16px;
    color: #222;
    background: #f1f2f3;
    border-bottom: 1px solid #e1e1e1;
}

.pw-mobile-drawer-title {
    margin: 0;
    color: #222;
    font-size: 16px;
    font-weight: 700;
}

.pw-mobile-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #555;
    background: transparent;
    border: 0;
    font-size: 22px;
    cursor: pointer;
}

.pw-mobile-tabs {
    display: flex;
    flex: 0 0 auto;
    border-bottom: 1px solid #e4e4e4;
    background: #f7f7f7;
}

.pw-mobile-tab {
    flex: 1 1 50%;
    min-height: 46px;
    padding: 12px 8px;
    color: #555;
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.pw-mobile-tab.is-active {
    color: #171717;
    background: #fff;
    border-bottom-color: #b99a60;
}

.pw-mobile-tab .fa {
    margin-right: 6px;
}

.pw-mobile-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.pw-mobile-tab-panel {
    display: none;
    padding: 0 0 18px;
}

.pw-mobile-tab-panel.is-active {
    display: block;
}

/* Drawer category accordion */
.pw-mobile-category-list,
.pw-mobile-account-list,
.pw-mobile-subcategory-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.pw-mobile-category-item {
    margin: 0;
    border-bottom: 1px solid #eaeaea;
}

.pw-mobile-category-row {
    display: flex;
    align-items: stretch;
    min-height: 48px;
}

.pw-mobile-category-link {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 16px;
    color: #242424;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.pw-mobile-category-link:hover,
.pw-mobile-category-link:focus {
    color: #98783f;
    background: #faf8f4;
    text-decoration: none;
}

.pw-mobile-accordion-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    color: #444;
    background: #fff;
    border: 0;
    font-size: 15px;
    cursor: pointer;
}

.pw-mobile-accordion-toggle .fa {
    transition: transform .2s ease;
}

.pw-mobile-category-item.is-expanded > .pw-mobile-category-row .pw-mobile-accordion-toggle .fa {
    transform: rotate(90deg);
}

.pw-mobile-subcategory-list {
    display: none;
    background: #f8f7f4;
}

.pw-mobile-category-item.is-expanded > .pw-mobile-subcategory-list {
    display: block;
}

.pw-mobile-subcategory-list a {
    display: block;
    padding: 11px 16px 11px 30px;
    color: #444;
    border-top: 1px solid #ece9e2;
    font-size: 12px;
    text-decoration: none;
}

.pw-mobile-subcategory-list a:hover,
.pw-mobile-subcategory-list a:focus {
    color: #98783f;
    background: #f1eee7;
}

.pw-mobile-see-all {
    display: block;
    padding: 12px 30px;
    color: #222;
    background: #f0f0f0;
    border-top: 1px solid #e5e5e5;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
}

/* Account panel */
.pw-mobile-account-list li {
    border-bottom: 1px solid #eaeaea;
}

.pw-mobile-account-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 18px;
    color: #292929;
    font-size: 13px;
    text-decoration: none;
}

.pw-mobile-account-list a .fa {
    width: 18px;
    color: #98783f;
    text-align: center;
}

.pw-mobile-account-list a:hover,
.pw-mobile-account-list a:focus {
    color: #98783f;
    background: #faf8f4;
}

body.pw-mobile-drawer-open {
    overflow: hidden;
}

/* Mobile-specific header only */
@media (max-width: 767px) {
    .pw-topbar-inner {
        display: block;
        min-height: 0;
        padding: 8px 10px;
    }

    .pw-topbar-announcement {
        justify-content: center;
        gap: 4px 6px;
        text-align: center;
        font-size: 10px;
    }

    .pw-topbar-announcement > .fa-truck {
        font-size: 12px;
    }

    .pw-topbar-links {
        display: none !important;
    }

    /* Keep desktop header untouched; replace it visually on mobile */
    .pw-header-main > .container {
        padding: 10px 12px;
    }

    .pw-header-main .pw-header-row {
        display: none !important;
    }

    .pw-mobile-utility {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 38px;
        padding: 7px 14px;
        color: #fff;
        background: #3158ad;
        font-size: 12px;
    }

    .pw-mobile-utility a {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: #fff;
        text-decoration: none;
    }

    .pw-mobile-utility-left {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .pw-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 64px;
        padding: 10px 14px;
        background: #fff;
        border-bottom: 1px solid #ededed;
    }

    .pw-mobile-menu-trigger,
    .pw-mobile-icon-link,
    .pw-mobile-cart-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        flex: 0 0 30px;
        width: 30px;
        height: 38px;
        padding: 0;
        color: #111;
        background: transparent;
        border: 0;
        font-size: 22px;
        text-decoration: none;
        cursor: pointer;
    }

    .pw-mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 0 0 auto;
    }

    .pw-mobile-header-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .pw-mobile-header-logo img {
        display: block;
        width: auto;
        max-width: 100%;
        max-height: 49px;
    }

    .pw-mobile-header-logo h1 {
        margin: 0;
        font-size: 19px;
        font-weight: 700;
    }

    .pw-mobile-header-logo a {
        color: #171717;
        text-decoration: none;
    }

    .pw-mobile-cart-count {
        position: absolute;
        top: -1px;
        right: -5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 16px;
        height: 16px;
        padding: 0 3px;
        color: #fff;
        background: #3158ad;
        border-radius: 9px;
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
    }

    .pw-mobile-search-row {
        display: none;
        padding: 8px 10px;
        background: #fff;
        border-bottom: 1px solid #e5e5e5;
    }

    .pw-mobile-search-row.is-open {
        display: block;
    }

    .pw-mobile-search-row .pw-search-wrapper {
        width: 100%;
    }

    .pw-mobile-search-row .pw-search-wrapper input {
        min-height: 40px;
        border-radius: 4px;
    }

    .pw-mobile-search-row .pw-search-wrapper .input-group-btn .btn {
        min-height: 40px;
    }

    .pw-menu-shell {
        display: none !important;
    }

    .pw-mobile-drawer {
        width: min(88vw, 370px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pw-mobile-overlay,
    .pw-mobile-drawer,
    .pw-mobile-accordion-toggle .fa {
        transition: none;
    }
}


/* ==========================================================
   CART DRAWER FIX — OPEN FROM THE RIGHT
   Targets the standard OpenCart #cart dropdown markup.
   ========================================================== */

@media (max-width: 767px) {
    /* Keep cart and its drawer above the header */
    .pw-header-main #cart {
        position: static;
    }

    .pw-header-main #cart.open::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 10990;
        display: block;
        background: rgba(0, 0, 0, .48);
    }

    .pw-header-main #cart > .dropdown-menu,
    .pw-header-main #cart.open > .dropdown-menu {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        z-index: 10991 !important;
        display: block !important;
        float: none !important;
        width: min(88vw, 380px) !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #222222;
        background: #ffffff !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: -8px 0 28px rgba(0, 0, 0, .20) !important;
        transform: translateX(105%);
        visibility: hidden;
        opacity: 1;
        transition: transform .28s ease, visibility .28s ease;
        -webkit-overflow-scrolling: touch;
    }

    .pw-header-main #cart.open > .dropdown-menu {
        transform: translateX(0);
        visibility: visible;
    }

    /* Prevent inherited dropdown item styles from breaking cart rows */
    .pw-header-main #cart > .dropdown-menu > li {
        position: relative;
        display: block;
        width: 100%;
        padding: 12px 16px;
        border-bottom: 1px solid #eeeeee;
        background: #ffffff;
    }

    .pw-header-main #cart > .dropdown-menu > li:first-child {
        padding-top: 16px;
    }

    .pw-header-main #cart > .dropdown-menu > li > p {
        margin: 0;
        padding: 12px 0;
        color: #555555;
        text-align: center;
    }

    .pw-header-main #cart > .dropdown-menu .table {
        margin-bottom: 0;
        border: 0;
    }

    .pw-header-main #cart > .dropdown-menu .table td,
    .pw-header-main #cart > .dropdown-menu .table th {
        padding: 8px 5px;
        vertical-align: middle;
        border-top: 1px solid #eeeeee;
    }

    .pw-header-main #cart > .dropdown-menu .text-right {
        text-align: right;
    }

    .pw-header-main #cart > .dropdown-menu .btn {
        white-space: normal;
    }

    /* Keep cart drawer above the backdrop */
    .pw-header-main #cart.open {
        z-index: 10991;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pw-header-main #cart > .dropdown-menu {
        transition: none;
    }
}
