/* ==========================================================================
   Machaleur - Stage 1 Enhancements & Brand Styling
   ========================================================================== */

/* 1. Typography: ONEST Font */
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&display=swap');

/* 2. Task 1.9: Reset browser focus & tap highlight (Eliminate black rectangles) */
*:focus,
*:active,
a:focus,
a:active,
button:focus,
button:active,
input:focus,
select:focus,
textarea:focus,
.panel-heading a:focus,
.panel-heading a:active,
.accordion-toggle:focus,
.dropdown-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* 3. Task 1.4: Header Geometry - reduced margins & compact height */
.header.header-compact .top-bar {
    display: none !important;
}
header.header-compact .header.header-compact {
    padding-bottom: 0 !important;
    border-bottom: 1px solid #f0f0f0;
}
.header.header-compact .mid-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
    min-height: 64px !important;
    height: 64px !important;
    box-sizing: border-box !important;
}

/* Center the logo in mid-bar - matching height (28px) and exact un-squished ratio (width: 172px) */
.desktop-logo-wrapper {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    z-index: 10;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 28px !important;
    width: 172px !important;
    max-width: 172px !important;
}
.desktop-logo-wrapper #logo,
#logo {
    height: 28px !important;
    width: 172px !important;
    max-width: 172px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.desktop-logo-wrapper #logo a,
#logo a {
    height: 28px !important;
    width: 172px !important;
    max-width: 172px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.desktop-logo-wrapper #logo img,
#logo a > img,
#logo img {
    height: 28px !important;
    max-height: 28px !important;
    width: 172px !important;
    min-width: 172px !important;
    max-width: 172px !important;
    object-fit: contain !important;
    display: block !important;
}

/* 4. Task 1.5: Burger Menu Button (matching height 28px, moved away from left border) */
.machaleur-burger-wrapper {
    display: flex;
    align-items: center;
    padding-left: 55px; /* Sits nicely away from left border */
    z-index: 100001;
    height: 28px;
}
.machaleur-burger-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    width: 34px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 100002;
    transition: transform 0.3s ease;
}
.machaleur-burger-btn span {
    display: block;
    width: 34px;
    height: 2px;
    background-color: #000000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    transform-origin: center;
}
/* Burger to Cross animation */
.machaleur-burger-btn.is-active span:nth-child(1) {
    transform: translateY(13px) rotate(45deg);
}
.machaleur-burger-btn.is-active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.machaleur-burger-btn.is-active span:nth-child(3) {
    transform: translateY(-13px) rotate(-45deg);
}

/* Slide-out Menu Drawer (100vh) & 20% Black Overlay - matching Верхнее меню. Левое меню.jpg */
.machaleur-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.2) !important; /* Exactly 20% black */
    z-index: 100005;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.machaleur-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.machaleur-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 360px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    z-index: 100010;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.08);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 18px 40px 40px 55px; /* Left padding 55px matches mockup x=55px */
    box-sizing: border-box;
}
.machaleur-drawer.is-open {
    transform: translateX(0);
}
.machaleur-drawer-header {
    display: flex;
    justify-content: flex-start; /* Cross button sits on the left at x=55px */
    margin-bottom: 50px; /* Exact distance to first menu item */
    height: 28px;
    align-items: center;
}
.machaleur-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    transition: color 0.2s ease;
}
.machaleur-drawer-close svg {
    width: 24px;
    height: 24px;
    display: block;
}
.machaleur-drawer-close:hover {
    color: #cbb185;
}
.machaleur-drawer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.machaleur-drawer-link {
    font-family: 'Onest', sans-serif !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    color: #000000 !important;
    text-decoration: none !important;
    display: inline-block;
    transition: color 0.2s ease;
    text-transform: none !important;
    letter-spacing: 0.3px;
}
.machaleur-drawer-link:hover {
    color: #cbb185 !important;
}
.machaleur-drawer-link.is-sale {
    color: #ee0000 !important;
    font-weight: 600 !important;
}
.machaleur-drawer-divider {
    width: 140px;
    border-top: 1px solid #eeeeee;
    margin: 12px 0;
}

/* 5. Right Icons (Search - Login - Wishlist - Cart, matching height 28px) */
.header-icons-group {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
    padding-right: 55px; /* Symmetrical breathing room on right edge */
    z-index: 10;
    height: 28px;
}
.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #000000 !important;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease, opacity 0.2s ease;
    text-decoration: none !important;
}
.header-icon-btn svg {
    display: block;
    color: #000000;
    transition: color 0.2s ease, stroke 0.2s ease;
}
.header-icon-btn:hover svg {
    color: #cbb185;
}

/* Optical balance adjustments: scale down search, scale up heart */
.header-icon-search svg {
    width: 23px !important;
    height: 23px !important;
}
.header-icon-account svg {
    width: 26px !important;
    height: 26px !important;
}
.header-icon-wishlist svg {
    width: 32px !important;
    height: 32px !important;
}
.header-icon-cart svg {
    width: 25px !important;
    height: 27px !important;
}

/* Dynamic Badge styling (Wishlist & Cart matching round badge) */
.count-badge.wishlist-badge,
.header-cart-wrapper #cart-items {
    position: absolute !important;
    top: -5px !important;
    right: -7px !important;
    min-width: 17px !important;
    height: 17px !important;
    border-radius: 50% !important;
    background: #000000 !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-family: 'Onest', sans-serif !important;
    font-weight: 600 !important;
    line-height: 17px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 4px !important;
    border: none !important;
    box-sizing: border-box !important;
    z-index: 5 !important;
}
.count-badge.wishlist-badge.count-zero,
.header-cart-wrapper #cart-items.count-zero {
    display: none !important;
}

/* Dropdown Search in Header */
.header-search-wrapper {
    position: relative;
}
.machaleur-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    width: 280px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    padding: 10px 14px;
    z-index: 9999;
}
.machaleur-search-dropdown.is-open {
    display: block;
}
.machaleur-search-dropdown input.search-input {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Onest', sans-serif;
    font-size: 14px;
}

/* 6. Account Page (ЛК) Cleanup & Logout Button */
.account-page .my-affiliates,
.account-page .my-newsletter,
.account-page .edit-downloads,
.account-page .edit-rewards,
.account-page .edit-recurring,
.account-page .edit-returns,
.account-page .edit-transactions {
    display: none !important;
}
.machaleur-account-logout-btn {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 35px;
    background: #000000;
    color: #ffffff !important;
    font-family: 'Onest', sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 3px;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}
.machaleur-account-logout-btn:hover {
    background-color: #cbb185;
}

/* 7. Cookies Consent Banner */
.machaleur-cookies-banner {
    position: fixed;
    bottom: 25px;
    left: 25px;
    right: 25px;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.14);
    border-radius: 8px;
    padding: 20px 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: machaleurFadeInUp 0.4s ease-out;
}
.machaleur-cookies-text {
    font-family: 'Onest', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #333333;
    margin: 0;
}
.machaleur-cookies-btn {
    align-self: flex-start;
    padding: 8px 24px;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: 'Onest', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.machaleur-cookies-btn:hover {
    background: #cbb185;
}

@keyframes machaleurFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .machaleur-burger-wrapper {
        padding-left: 20px;
    }
    .header-icons-group {
        padding-right: 20px;
        gap: 16px;
    }
    .desktop-logo-wrapper,
    .desktop-logo-wrapper #logo,
    .desktop-logo-wrapper #logo a,
    .desktop-logo-wrapper #logo img {
        height: 24px !important;
        max-height: 24px !important;
        width: 148px !important;
        min-width: 148px !important;
        max-width: 148px !important;
        object-fit: contain !important;
    }
}

/* Prevent horizontal overflow on mobile from wide modules/sliders */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    .site-wrapper {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100% !important;
    }
    .mobile-header {
        max-width: 100vw !important;
        width: 100% !important;
        position: relative !important;
    }
}

/* ==========================================================================
   Mobile Header (Matching 2MOOD layout: Burger+Search | White Logo | LK+Wish+Cart)
   ========================================================================== */
.mobile-header .mobile-top-bar {
    display: none !important;
}
.machaleur-mobile-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    background-color: #28282a !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* 1. Left Nav Controls */
.mobile-nav-controls {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    z-index: 10 !important;
}
.mobile-burger-btn {
    width: 22px !important;
    height: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
}
.mobile-burger-btn span {
    display: block !important;
    width: 22px !important;
    height: 2px !important;
    background-color: #ffffff !important;
    border-radius: 1px !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease !important;
    transform-origin: center !important;
}
.mobile-burger-btn.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
}
.mobile-burger-btn.is-active span:nth-child(2) {
    opacity: 0 !important;
    transform: scaleX(0) !important;
}
.mobile-burger-btn.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
}

.mobile-icon-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    position: relative !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease !important;
}
.mobile-icon-btn:hover {
    opacity: 0.8 !important;
}
.mobile-search-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
    display: block !important;
}

/* 2. Center White Logo */
.mobile-logo-center {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
    pointer-events: auto !important;
}
.mobile-logo-center #mobile-logo,
.mobile-logo-center #mobile-logo a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 22px !important;
    text-decoration: none !important;
}
.mobile-logo-center #mobile-logo img {
    height: 22px !important;
    max-height: 22px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 140px !important;
    object-fit: contain !important;
    display: block !important;
    filter: brightness(0) invert(1) !important; /* Pure white guarantee */
}

/* 3. Right Icons: LK + Wishlist + Cart */
.mobile-right-icons {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin-left: auto !important;
    z-index: 10 !important;
}
.mobile-account-btn svg {
    width: 21px !important;
    height: 21px !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
    display: block !important;
}
.mobile-wishlist-btn svg {
    width: 24px !important;
    height: 24px !important;
    fill: #ffffff !important;
    color: #ffffff !important;
    display: block !important;
}
.mobile-cart-btn svg {
    width: 20px !important;
    height: 22px !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
    display: block !important;
}

/* Mobile Badge Styling */
.mobile-right-icons .count-badge {
    position: absolute !important;
    top: -5px !important;
    right: -7px !important;
    min-width: 15px !important;
    height: 15px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9px !important;
    font-family: 'Onest', sans-serif !important;
    font-weight: 700 !important;
    line-height: 15px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 3px !important;
    border: none !important;
    box-sizing: border-box !important;
    z-index: 5 !important;
}
.mobile-right-icons .count-badge.count-zero {
    display: none !important;
}

/* Responsive adjustments for compact phones */
@media (max-width: 400px) {
    .machaleur-mobile-bar {
        padding: 0 12px !important;
    }
    .mobile-nav-controls {
        gap: 12px !important;
    }
    .mobile-right-icons {
        gap: 12px !important;
    }
    .mobile-logo-center #mobile-logo img {
        max-width: 120px !important;
        height: 20px !important;
    }
}
@media (max-width: 360px) {
    .machaleur-mobile-bar {
        padding: 0 8px !important;
    }
    .mobile-nav-controls {
        gap: 8px !important;
    }
    .mobile-right-icons {
        gap: 8px !important;
    }
    .mobile-logo-center #mobile-logo img {
        max-width: 105px !important;
        height: 18px !important;
    }
}

/* Mobile Search Dropdown */
.machaleur-search-dropdown.mobile-search-dropdown {
    display: none;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    padding: 10px 16px !important;
    box-sizing: border-box !important;
    z-index: 1000 !important;
    border-radius: 0 0 8px 8px !important;
}
.machaleur-search-dropdown.mobile-search-dropdown.is-open {
    display: block !important;
}
.mobile-search-dropdown .header-search {
    display: flex !important;
    align-items: center !important;
    position: relative !important;
    width: 100% !important;
}
.mobile-search-dropdown .search-input {
    width: 100% !important;
    height: 40px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    padding: 0 40px 0 14px !important;
    font-family: 'Onest', sans-serif !important;
    font-size: 14px !important;
    color: #000000 !important;
    background: #f8f8f8 !important;
    box-sizing: border-box !important;
}
.mobile-search-dropdown .search-button {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}
.mobile-search-dropdown .search-button::before,
.mobile-search-dropdown .search-button::after {
    display: none !important;
    content: none !important;
}

/* Mobile Drawer refinement */
@media (max-width: 768px) {
    .machaleur-drawer {
        width: 310px !important;
        max-width: 85vw !important;
        padding: 18px 25px 35px 25px !important;
    }
    .machaleur-drawer-header {
        margin-bottom: 35px !important;
    }
    .machaleur-drawer-close {
        width: 24px !important;
        height: 24px !important;
    }
    .machaleur-drawer-close svg {
        width: 20px !important;
        height: 20px !important;
    }
    .machaleur-drawer-list {
        gap: 16px !important;
    }
    .machaleur-drawer-link {
        font-size: 15px !important;
    }
}
