/* ====================================
   BUYER MAIN CSS - Core Buyer Portal Styling
   PARTSFORM Professional Design
   ==================================== */


/* Variables now provided by brand-system.css backward-compatibility aliases */


/* ====================================
   GLOBAL BUYER PAGE STYLES
   ==================================== */

/* Buyer content column — shared by .container and [class$="-header-bar"] kintsugi accent */
:root {
    --buyer-col-max: min(var(--container-max, 1320px), 92vw);
    --buyer-col-pad-x: 2rem;
}

/* Remove all border-radius on buyer pages (square edges everywhere) */
body:has(.orders-page) *,
body:has(.cart-page) *,
body:has(.checkout-page) *,
body:has(.claims-page) *,
body:has(.claim-details-page) *,
body:has(.affiliate-page) *,
body:has(.aboutus-page) *,
body:has(.contacts-page) *,
body:has(.profile-page) *,
body:has(.settings-page) *,
body:has(.delivery-page) *,
body:has(.payment-page) *,
body:has(.create-claim-page) *,
body:has(.order-details-page) *,
body:has(.searchv2-page) * {
    border-radius: 0 !important;
}

/* Global Container — aligned with styles.css / --container-max */

.container {
    width: 100%;
    max-width: var(--buyer-col-max);
    margin: 0 auto;
    padding: 0 var(--buyer-col-pad-x);
    box-sizing: border-box;
}

.buyer-page {
    min-height: 100vh;
    background: var(--buyer-bg-secondary);
    padding-top: 5rem;
}

.buyer-container {
    width: 100%;
    max-width: var(--buyer-col-max);
    margin: 0 auto;
    padding: 0 var(--buyer-col-pad-x);
    box-sizing: border-box;
}


/* ====================================
   SHARED BUYER PAGE HERO - Title Bar
   ==================================== */

[class$="-header-bar"] {
    flex-shrink: 0;
    background: linear-gradient(to bottom, var(--washi) 0%, rgba(149, 175, 192, 0.05) 100%);
    padding: 1.5rem 0 1.25rem;
    border-bottom: 1px solid rgba(149, 175, 192, 0.2);
    margin-top: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

[class$="-header-bar"]::before {
    content: '';
    position: absolute;
    bottom: -1px;
    inset-inline-start: max(0px, calc((100% - var(--buyer-col-max)) / 2 + var(--buyer-col-pad-x)));
    width: 200px;
    height: 2px;
    background: linear-gradient(to right, var(--kintsugi), transparent);
    animation: buyerHeaderShimmer 3s ease-in-out infinite;
}

@keyframes buyerHeaderShimmer {
    0%, 100% { opacity: 1; transform: translateX(0); }
    50% { opacity: 0.7; transform: translateX(20px); }
}

[class$="-header-title"] {
    font-family: 'Quantico', sans-serif;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: var(--font-display-weight, 900);
    color: var(--kurogane);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    line-height: 1.1;
}


/* ====================================
   BUYER CARDS - Base Styles
   ==================================== */

.buyer-card {
    background: var(--buyer-bg-primary);
    border-radius: 0 !important;
    border: 1px solid var(--buyer-border);
    padding: var(--buyer-space-lg);
    transition: var(--buyer-transition);
    box-shadow: var(--buyer-shadow-sm);
}

.buyer-card:hover {
    box-shadow: var(--buyer-shadow-lg);
    transform: translateY(-4px);
    border-color: var(--buyer-accent);
}

.buyer-card-header {
    margin-bottom: var(--buyer-space-md);
    padding-bottom: var(--buyer-space-md);
    border-bottom: 1px solid var(--buyer-border-light);
}

.buyer-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--buyer-text-primary);
    margin: 0;
}

.buyer-card-subtitle {
    font-size: 0.95rem;
    color: var(--buyer-text-muted);
    margin-top: 0.5rem;
}

.buyer-card-body {
    padding: var(--buyer-space-md) 0;
}

.buyer-card-footer {
    margin-top: var(--buyer-space-md);
    padding-top: var(--buyer-space-md);
    border-top: 1px solid var(--buyer-border-light);
}


/* ====================================
   BUYER BUTTONS
   ==================================== */

.buyer-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0 !important;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--buyer-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.buyer-btn-primary {
    background: var(--buyer-primary);
    color: white;
    box-shadow: var(--buyer-shadow-sm);
}

.buyer-btn-primary:hover {
    background: var(--buyer-primary-dark);
    box-shadow: var(--buyer-shadow-md);
    transform: translateY(-2px);
}

.buyer-btn-accent {
    background: var(--buyer-accent);
    color: white;
    box-shadow: var(--buyer-shadow-sm);
}

.buyer-btn-accent:hover {
    background: var(--buyer-accent-dark);
    box-shadow: var(--buyer-shadow-md);
    transform: translateY(-2px);
}

.buyer-btn-secondary {
    background: var(--buyer-bg-accent);
    color: var(--buyer-primary);
    border: 1px solid var(--buyer-border);
}

.buyer-btn-secondary:hover {
    background: var(--buyer-primary);
    color: white;
}

.buyer-btn-outline {
    background: transparent;
    color: var(--buyer-primary);
    border: 2px solid var(--buyer-primary);
}

.buyer-btn-outline:hover {
    background: var(--buyer-primary);
    color: white;
}


/* ====================================
   BUYER BADGES
   ==================================== */

.buyer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0 !important;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--buyer-bg-accent);
    color: var(--buyer-primary);
}

.buyer-badge i {
    width: 16px;
    height: 16px;
}


/* ====================================
   BUYER GRID SYSTEM
   ==================================== */

.buyer-grid {
    display: grid;
    gap: var(--buyer-space-lg);
}

.buyer-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.buyer-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.buyer-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}


/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 1200px) {

    :root {
        --buyer-col-pad-x: var(--buyer-space-md);
    }
}

@media (max-width: 768px) {
    .buyer-page {
        padding-top: 4rem;
    }

    :root {
        --buyer-col-pad-x: var(--buyer-space-sm);
    }

    .buyer-card {
        padding: var(--buyer-space-md);
    }

    .buyer-grid {
        gap: var(--buyer-space-md);
    }

    .buyer-grid-2,
    .buyer-grid-3,
    .buyer-grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {

    :root {
        --buyer-col-pad-x: 1rem;
    }

    .buyer-btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}


/* ====================================
   NAVBAR BASE STYLES
   ==================================== */


/* Ensure navbar allows dropdown to overflow */

.nav-bar {
    overflow: visible !important;
}


/* ====================================
   NAVBAR DROPDOWN MENU
   ==================================== */

.nav-dropdown {
    position: relative;
}

.nav-dropdown .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.625rem 0;
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: var(--font-display-weight-compact, 700);
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
}

.nav-bar.scrolled .nav-dropdown .dropdown-trigger {
    color: rgba(255, 255, 255, 0.82);
}

.nav-dropdown .dropdown-trigger:hover,
.nav-dropdown .dropdown-trigger.active {
    color: var(--sei, #95AFC0);
}

.nav-bar.scrolled .nav-dropdown .dropdown-trigger:hover,
.nav-bar.scrolled .nav-dropdown .dropdown-trigger.active {
    color: var(--sei, #95AFC0);
}

.nav-dropdown .dropdown-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.nav-dropdown.open .dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #ffffff;
    border-radius: 0 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(209, 213, 219, 0.5);
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1000;
    overflow: hidden;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--kurogane);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(209, 213, 219, 0.4);
}

.nav-dropdown-item:last-child {
    border-bottom: none;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
    background: rgba(149, 175, 192, 0.12);
}

.nav-dropdown-item.active {
    color: var(--sei, #95AFC0);
}

.user-dropdown-item.active {
    background: rgba(149, 175, 192, 0.12);
    color: var(--sei, #95AFC0);
}

.nav-dropdown-item i {
    width: 22px;
    height: 22px;
    color: var(--kintsugi);
    flex-shrink: 0;
}

.nav-dropdown-item div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dropdown-item-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--kurogane);
}

.dropdown-item-desc {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--namari);
}


@media (max-width: 992px) {
    .nav-links {
        gap: 1rem;
        padding: 0 0.75rem;
    }

    .nav-link {
        font-size: 0.6875rem;
    }

    .nav-dropdown .dropdown-trigger {
        font-size: 0.6875rem;
        gap: 0.25rem;
    }

    .nav-dropdown .dropdown-chevron {
        width: 12px;
        height: 12px;
    }
}


/* Mobile responsive styles for nav dropdowns */

@media (max-width: 768px) {
    .nav-dropdown-menu {
        position: static;
        width: 100%;
        border-radius: 0 !important;
        margin-top: 0.5rem;
        min-width: unset;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        transform: translateY(0);
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }

    .nav-dropdown-item {
        padding: 0.875rem 1rem;
    }

    .dropdown-item-title {
        font-size: 0.9rem;
    }

    .dropdown-item-desc {
        font-size: 0.7rem;
    }
}


/* ====================================
   BUYER NAVBAR - RESPONSIVE FIXES
   Fix nav-links disappearing at 768px, align with hamburger breakpoint
   ==================================== */

/* Tablet (992px): Ensure hamburger shows, nav-links in panel */
@media (max-width: 992px) {
    .nav-container {
        flex-wrap: nowrap;
    }
}

/* Fix: styles.css hides nav-links at 768px - ensure .active overrides */
@media (max-width: 768px) {
    .nav-links.active {
        display: flex !important;
    }
}


/* Cart Button in Navbar */

.btn-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 50% !important;
    overflow: visible;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.btn-cart:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    color: var(--kintsugi);
    border-radius: 50% !important;
}

.btn-cart:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px var(--kintsugi);
    border-radius: 50% !important;
}

.btn-cart i {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.btn-cart .cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kintsugi, #D4AF37);
    color: var(--kurogane);
    border-radius: 9999px !important;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    padding: 0 5px;
    border: none !important;
    outline: none !important;
    box-sizing: border-box;
    box-shadow: none !important;
    animation: cartBadgePulse 2s ease-in-out infinite;
}

@keyframes cartBadgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ====================================
   CART ALERTS - GLOBAL (Works on all pages)
   ==================================== */

.cart-alerts {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    pointer-events: none;
}

.cart-alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 0 !important;
    box-shadow: var(--buyer-shadow-xl);
    border-left: 4px solid;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
}

.cart-alert.success {
    border-color: var(--sei, #95AFC0);
}

.cart-alert.error {
    border-color: var(--kintsugi, #D4AF37);
}

.cart-alert.info {
    border-color: var(--buyer-accent);
}

.cart-alert-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.cart-alert.success .cart-alert-icon {
    color: var(--sei, #95AFC0);
}

.cart-alert.error .cart-alert-icon {
    color: var(--kintsugi, #D4AF37);
}

.cart-alert.info .cart-alert-icon {
    color: var(--buyer-accent);
}

.cart-alert-content {
    flex: 1;
}

.cart-alert-title {
    font-weight: 700;
    color: var(--buyer-text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.cart-alert-message {
    color: var(--buyer-text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.cart-alert-message--multiline {
    white-space: pre-line;
}

.cart-alert-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--buyer-text-muted);
    transition: var(--buyer-transition-fast);
    padding: 0;
}

.cart-alert-close:hover {
    opacity: 0.85;
}

.cart-alert-close i {
    width: 16px;
    height: 16px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ====================================
   CURRENCY CONVERTER
   ==================================== */


/* Currency Converter Button in Navbar */

.btn-currency-converter {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    background: var(--buyer-bg-accent);
    border: 1px solid transparent;
    border-radius: 0 !important;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    min-width: fit-content;
    max-width: 140px;
}

.btn-currency-converter::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.5s ease;
}

.btn-currency-converter:hover::before {
    left: 100%;
}

.btn-currency-converter:hover {
    background: var(--aitetsu);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(64, 84, 94, 0.35), 0 0 15px rgba(64, 84, 94, 0.2);
    border-color: rgba(64, 84, 94, 0.3);
}

.btn-currency-converter:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-currency-converter i {
    width: 14px;
    height: 14px;
    color: var(--buyer-accent);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.btn-currency-converter:hover i {
    color: white;
    transform: rotate(180deg) scale(1.1);
}

.btn-currency-converter .currency-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--buyer-text-muted);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.btn-currency-converter:hover .currency-label {
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
}

.btn-currency-converter .currency-code-display {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--buyer-accent);
    transition: all 0.3s ease;
}

.btn-currency-converter:hover .currency-code-display {
    color: white;
    transform: scale(1.05);
}


/* ====================================
   PREFERRED CURRENCY DROPDOWN
   ==================================== */

.preferred-currency-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}


.btn-preferred-currency {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    background: var(--kintsugi);
    color: var(--kurogane);
    border: none;
    border-radius: 0 !important;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(64, 84, 94, 0.3);
    white-space: nowrap;
}

.btn-preferred-currency:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 84, 94, 0.4);
}

.btn-preferred-currency.active {
    box-shadow: 0 4px 12px rgba(64, 84, 94, 0.4);
}

.btn-preferred-currency i {
    width: 14px;
    height: 14px;
    color: white;
}

.btn-preferred-currency .currency-dropdown-chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
    color: white;
}

.btn-preferred-currency.active .currency-dropdown-chevron {
    transform: rotate(180deg);
}

.preferred-currency-code {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.preferred-currency-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    max-height: 450px;
    background: var(--buyer-bg-primary);
    border: 1.5px solid rgba(0, 167, 225, 0.3);
    border-radius: 0 !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 167, 225, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preferred-currency-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.preferred-currency-header {
    padding: 16px 18px;
    background: rgba(0, 167, 225, 0.15);
    border-bottom: 1px solid rgba(0, 167, 225, 0.2);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--buyer-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.preferred-currency-header::before {
    content: '💱';
    font-size: 1.1rem;
}

.preferred-currency-search {
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(0, 167, 225, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
}

.preferred-currency-search .search-icon {
    width: 18px;
    height: 18px;
    color: var(--buyer-accent);
}

.preferred-currency-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.9rem;
    color: var(--buyer-text-primary);
}

.preferred-currency-search input::placeholder {
    color: var(--buyer-text-muted);
}

.preferred-currency-list {
    flex: 1;
    overflow-y: auto;
    max-height: 320px;
    padding: 10px;
}

.preferred-currency-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 0 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    margin-bottom: 4px;
}

.preferred-currency-item:hover {
    background: rgba(64, 84, 94, 0.12);
    transform: translateX(4px);
}

.preferred-currency-item.active {
    background: rgba(64, 84, 94, 0.2);
    border-left: 3px solid var(--v2-aitetsu, #40545E);
}

.preferred-currency-item.original-price {
    background: rgba(255, 193, 7, 0.15);
    border: 1px dashed rgba(255, 193, 7, 0.5);
    margin-bottom: 10px;
}

.preferred-currency-item.original-price:hover {
    background: rgba(255, 193, 7, 0.25);
}

.preferred-currency-item.original-price.active {
    border: 1px solid rgba(255, 193, 7, 0.8);
    border-left: 3px solid #ffc107;
}

.preferred-currency-item .currency-flag {
    font-size: 1.4rem;
}

.preferred-currency-item .currency-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.preferred-currency-item .currency-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--buyer-text-primary);
}

.preferred-currency-item .currency-full {
    font-size: 0.78rem;
    color: var(--buyer-text-muted);
}

.preferred-currency-item .check-icon {
    width: 18px;
    height: 18px;
    color: var(--buyer-accent);
}

.no-currency-results {
    padding: 24px;
    text-align: center;
    color: var(--buyer-text-muted);
    font-size: 0.9rem;
}


/* Currency Converter Modal */


/* Hidden utility class */

.hidden {
    display: none !important;
}

/* Currency Converter Modal - emoji flags, clean layout */
.cc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cc-modal.active {
    opacity: 1;
    visibility: visible;
}

.cc-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 43, 61, 0.85);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.cc-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    background: var(--buyer-bg-primary);
    border-radius: 0 !important;
    box-shadow: var(--buyer-shadow-xl);
    max-width: 420px;
    width: 92%;
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
    overflow: visible;
}

.cc-modal.active .cc-dialog {
    transform: scale(1) translateY(0);
}

.cc-dialog::-webkit-scrollbar {
    width: 10px;
}

.cc-dialog::-webkit-scrollbar-track {
    background: var(--buyer-bg-tertiary);
    border-radius: 0 !important;
}

.cc-dialog::-webkit-scrollbar-thumb {
    background: var(--buyer-accent);
    border-radius: 0 !important;
}

.cc-dialog {
    scrollbar-width: thin;
    scrollbar-color: var(--buyer-accent) var(--buyer-bg-tertiary);
}

.cc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0.5rem;
}

.cc-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--buyer-text-primary);
    margin: 0;
    line-height: 1.2;
}

.cc-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--buyer-bg-tertiary);
    border: none;
    border-radius: 0 !important;
    cursor: pointer;
    transition: var(--buyer-transition);
}

.cc-close:hover {
    opacity: 0.85;
}

.cc-close i {
    width: 20px;
    height: 20px;
}

.cc-body {
    padding: 0.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cc-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
}

.cc-row .cc-input,
.cc-row .cc-result {
    flex: 1;
    min-width: 0;
}

.cc-select-wrap {
    flex-shrink: 0;
    position: relative;
    min-width: 100px;
}

.cc-input {
    min-height: 44px;
    padding: 0.6rem 0.85rem;
    background: var(--buyer-bg-secondary);
    border: 2px solid var(--buyer-border);
    border-radius: 0 !important;
    font-size: 1rem;
    font-weight: 600;
    color: var(--buyer-text-primary);
    transition: var(--buyer-transition);
}

.cc-input:focus {
    outline: none;
    border-color: var(--aitetsu);
    background: var(--buyer-bg-primary);
    box-shadow: 0 0 0 3px rgba(64, 84, 94, 0.12);
}

.cc-result {
    min-height: 44px;
    padding: 0.6rem 0.85rem;
    background: rgba(149, 175, 192, 0.06);
    border: 2px solid var(--buyer-border);
    border-radius: 0 !important;
    font-size: 1rem;
    font-weight: 700;
    color: var(--buyer-accent-dark);
    cursor: default;
}

.cc-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 100px;
    height: 100%;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    background: var(--buyer-bg-secondary);
    border: 2px solid var(--buyer-border);
    border-radius: 0 !important;
    cursor: pointer;
    transition: var(--buyer-transition);
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--buyer-text-primary);
    text-align: left;
}

.cc-select:hover {
    border-color: var(--buyer-border);
    background: var(--buyer-bg-primary);
}

/* Flag-icon-css (same as language picker - works on all OSes) */
.cc-flag {
    width: 20px;
    height: 14px;
    min-width: 20px;
    min-height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
    display: inline-block;
}

.cc-chevron {
    width: 14px;
    height: 14px;
    color: var(--buyer-text-muted);
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.cc-select-wrap:has(.cc-dropdown.open) .cc-chevron {
    transform: rotate(180deg);
}

.cc-swap {
    align-self: center;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--buyer-text-muted);
    color: white;
    border: none;
    border-radius: 0 !important;
    cursor: pointer;
    transition: var(--buyer-transition);
    flex-shrink: 0;
}

.cc-swap i {
    width: 16px;
    height: 16px;
}

.cc-swap:hover {
    background: var(--aitetsu);
}

.cc-rate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.5rem 0;
    font-size: 0.8rem;
    color: var(--buyer-text-secondary);
}

.cc-rate #rateText {
    font-weight: 700;
    color: var(--aitetsu);
}

.cc-rate #rateUpdated {
    font-size: 0.75rem;
    color: var(--buyer-text-muted);
}

/* Currency dropdown */
.cc-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    min-width: 220px;
    max-height: 200px;
    background: var(--buyer-bg-primary);
    border: 2px solid var(--buyer-border);
    border-radius: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.cc-dropdown.open {
    display: flex;
}

.cc-search {
    flex-shrink: 0;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--buyer-border);
    background: var(--buyer-bg-secondary);
    border: none;
    border-radius: 0 !important;
    font-size: 0.8rem;
    color: var(--buyer-text-primary);
}

.cc-search:focus {
    outline: none;
    border-bottom-color: var(--aitetsu);
}

.cc-list {
    flex: 1;
    min-height: 0;
    max-height: 160px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.35rem;
}

.cc-list::-webkit-scrollbar {
    width: 6px;
}

.cc-list::-webkit-scrollbar-thumb {
    background: var(--buyer-accent);
    border-radius: 0 !important;
}

.cc-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    background: var(--buyer-bg-secondary);
    border: 1px solid transparent;
    border-radius: 0 !important;
    cursor: pointer;
    transition: var(--buyer-transition);
    text-align: left;
    font-size: 0.85rem;
}

.cc-list-item .fi,
.cc-list-item .currency-flag {
    width: 20px;
    height: 14px;
    min-width: 20px;
    flex-shrink: 0;
    border-radius: 2px;
}

.cc-list-item .cc-list-code {
    font-weight: 700;
    color: var(--buyer-text-primary);
}

.cc-list-item .cc-list-name {
    color: var(--buyer-text-muted);
}

.cc-list-item:hover {
    background: rgba(64, 84, 94, 0.06);
}

.no-currency-results {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--buyer-text-muted);
}

/* Responsive Design */

@media (max-width: 768px) {
    .nav-dropdown-menu {
        min-width: 240px;
    }

    /* Currency Converter Mobile */
    .cc-body {
        padding: 0.5rem 1.25rem 1.25rem;
    }

    .cc-title {
        font-size: 1.15rem;
    }

    .btn-currency-converter .currency-label {
        display: none;
    }

    .btn-currency-converter {
        gap: 0.25rem;
        padding: 0.6rem 0.65rem;
        max-width: 48px;
        min-width: 48px;
    }

    .btn-currency-converter .currency-code-display {
        font-size: 0.75rem;
    }

    .btn-currency-converter i {
        width: 14px;
        height: 14px;
    }

    /* Preferred Currency Dropdown Mobile */
    .btn-preferred-currency {
        padding: 8px 12px;
        gap: 6px;
    }

    .btn-preferred-currency i:first-child {
        width: 16px;
        height: 16px;
    }

    .preferred-currency-code {
        font-size: 0.8rem;
        min-width: 50px;
    }

    .preferred-currency-menu {
        width: 290px;
        right: -20px;
        max-height: 400px;
    }

    .preferred-currency-item {
        padding: 10px 12px;
    }

    .preferred-currency-header {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .preferred-currency-search {
        padding: 10px 12px;
    }
}


/* ====================================
   LANGUAGE SELECTOR - ENHANCED
   ==================================== */

.language-selector {
    position: relative;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    background: var(--buyer-bg-accent);
    border: 2px solid transparent;
    border-radius: 0 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
    min-width: fit-content;
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: left 0.5s ease;
}

.language-btn:hover::before {
    left: 100%;
}

.language-btn:hover {
    background: var(--aitetsu);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(64, 84, 94, 0.4), 0 0 20px rgba(64, 84, 94, 0.2);
    border-color: rgba(64, 84, 94, 0.3);
}

.language-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.language-selector.open .language-btn {
    background: var(--aitetsu);
}

.language-selector.open .lang-code,
.language-selector.open .lang-chevron {
    color: white;
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.language-btn:hover .lang-flag {
    transform: scale(1.15);
}

.lang-code {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--buyer-accent);
    transition: all 0.3s ease;
}

.language-btn:hover .lang-code,
.language-selector.open .lang-code {
    color: white;
    transform: scale(1.05);
}

.lang-chevron {
    width: 14px;
    height: 14px;
    color: var(--buyer-accent);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.language-btn:hover .lang-chevron,
.language-selector.open .lang-chevron {
    color: white;
    transform: rotate(180deg) scale(1.1);
}


/* ====================================
   NAVBAR SCROLLED STATE - Button Fixes
   ==================================== */


/* Override conflicting styles from styles.css */

.language-dropdown {
    background: white !important;
    backdrop-filter: none !important;
}

.nav-bar.scrolled .language-dropdown {
    background: white !important;
    border-color: rgba(64, 84, 94, 0.2) !important;
}


/* Language button when navbar is scrolled (glass effect) */

.nav-bar.scrolled .language-btn {
    background: rgba(64, 84, 94, 0.1);
    border: 2px solid rgba(64, 84, 94, 0.2);
}

.nav-bar.scrolled .language-btn:hover,
.nav-bar.scrolled .language-selector.open .language-btn {
    background: var(--aitetsu);
    border-color: var(--buyer-accent);
}

.nav-bar.scrolled .lang-code {
    color: var(--buyer-accent);
}

.nav-bar.scrolled .lang-chevron {
    color: var(--buyer-accent);
}

.nav-bar.scrolled .language-btn:hover .lang-code,
.nav-bar.scrolled .language-btn:hover .lang-chevron,
.nav-bar.scrolled .language-selector.open .lang-code,
.nav-bar.scrolled .language-selector.open .lang-chevron {
    color: white;
}


/* Currency button when navbar is scrolled */

.nav-bar.scrolled .btn-currency-converter {
    background: rgba(64, 84, 94, 0.1);
    border: 2px solid rgba(64, 84, 94, 0.2);
}

.nav-bar.scrolled .btn-currency-converter:hover {
    background: var(--aitetsu);
    border-color: var(--buyer-accent);
}

.nav-bar.scrolled .btn-currency-converter .currency-label {
    color: var(--buyer-text-secondary);
}

.nav-bar.scrolled .btn-currency-converter .currency-code-display {
    color: var(--buyer-accent);
}

.nav-bar.scrolled .btn-currency-converter i {
    color: var(--buyer-accent);
}

.nav-bar.scrolled .btn-currency-converter:hover .currency-label,
.nav-bar.scrolled .btn-currency-converter:hover .currency-code-display,
.nav-bar.scrolled .btn-currency-converter:hover i {
    color: white;
}


/* Cart button when navbar is scrolled */

.nav-bar.scrolled .btn-cart {
    background: rgba(64, 84, 94, 0.08);
    color: var(--aitetsu);
    border: 1.5px solid rgba(64, 84, 94, 0.2);
    border-radius: 50% !important;
}

.nav-bar.scrolled .btn-cart:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
    color: var(--kintsugi);
    border-radius: 50% !important;
}


.language-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: 14rem;
    background: white !important;
    border: 2px solid var(--buyer-border);
    border-radius: 0 !important;
    box-shadow: var(--buyer-shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
    overflow: hidden;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.lang-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: white !important;
    border: none;
    border-bottom: 1px solid var(--buyer-border-light);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: var(--buyer-bg-accent) !important;
    transform: translateX(4px);
}

.lang-option .lang-flag {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.lang-name {
    font-size: 0.875rem;
    color: var(--buyer-text-primary) !important;
    font-weight: 500;
}

.lang-option:hover .lang-name {
    color: var(--buyer-accent) !important;
    font-weight: 600;
}


/* ====================================
   NAV ACTIONS - REORGANIZED & ENHANCED
   ==================================== */

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}


/* Ensure consistent button heights */

.btn-cart,
.btn-tools-hamburger {
    height: 42px;
    align-items: center;
}


/* Responsive adjustments for nav actions */

@media (max-width: 768px) {
    .nav-actions {
        gap: 0.375rem;
    }

    .btn-cart,
    .btn-tools-hamburger {
        height: 38px;
        width: 38px;
    }

    .language-btn {
        padding: 0.5rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .cc-dialog {
        width: 95%;
        max-height: 90vh;
    }

    .cc-body {
        padding: 0.5rem 1rem 1rem;
    }

    .cc-input {
        font-size: 1.05rem;
        padding: 0.7rem 0.85rem;
    }

    .cc-close {
        width: 36px;
        height: 36px;
    }
}

/* Small height viewport */
@media (max-height: 560px) {
    .cc-modal {
        align-items: flex-start;
        padding: 1rem 0;
    }

    .cc-dialog {
        max-height: 85vh;
        margin: auto 0;
    }

    .cc-body {
        padding: 0.5rem 1.25rem 1.25rem;
    }

    .cc-title {
        font-size: 1.1rem;
    }
}


/* ====================================
   TOOLS HAMBURGER DROPDOWN
   ==================================== */


/* Tools Wrapper */

.nav-tools-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}


/* Hamburger Button */

.btn-tools-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50% !important;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.btn-tools-hamburger:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    border-radius: 50% !important;
}

.btn-tools-hamburger:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 2px var(--kintsugi);
    border-radius: 50% !important;
}

.btn-tools-hamburger[aria-expanded='true'] {
    background: rgba(212, 175, 55, 0.18);
    border-color: rgba(212, 175, 55, 0.45);
    border-radius: 50% !important;
}


/* Scrolled state */

.nav-bar.scrolled .btn-tools-hamburger {
    background: rgba(64, 84, 94, 0.08);
    border: 1.5px solid rgba(64, 84, 94, 0.2);
    border-radius: 50% !important;
}

.nav-bar.scrolled .btn-tools-hamburger:hover {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
    border-radius: 50% !important;
}

.nav-bar.scrolled .btn-tools-hamburger[aria-expanded='true'] {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    border-radius: 50% !important;
}


/* Hamburger Lines */

.tools-hamburger-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
}

.tools-line {
    display: block;
    width: 16px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.nav-bar.scrolled .tools-line {
    background: var(--aitetsu);
}

.btn-tools-hamburger:hover .tools-line {
    background: var(--kintsugi);
}

.btn-tools-hamburger[aria-expanded='true'] .tools-line {
    background: var(--kintsugi);
}

.nav-bar.scrolled .btn-tools-hamburger[aria-expanded='true'] .tools-line {
    background: var(--kintsugi);
}


/* Animate to X when open */

.btn-tools-hamburger[aria-expanded='true'] .tools-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.btn-tools-hamburger[aria-expanded='true'] .tools-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.btn-tools-hamburger[aria-expanded='true'] .tools-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}


/* Dropdown Menu */

.tools-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: white !important;
    border: 1px solid rgba(149, 175, 192, 0.25) !important;
    border-radius: 0 !important;
    box-shadow: 0 8px 32px rgba(43, 43, 43, 0.15) !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 10001;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 85vh;
}

.tools-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}


/* Dropdown Arrow */

.tools-dropdown-arrow {
    position: absolute;
    top: -5px;
    right: 15px;
    width: 10px;
    height: 10px;
    background: white !important;
    border: 1px solid rgba(149, 175, 192, 0.25) !important;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    z-index: 1;
}


/* Sections */

.tools-dropdown-section {
    padding: 0.25rem 0;
    min-width: 0;
    overflow: hidden;
}

.tools-section-label {
    padding: 0.4rem 1.25rem 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(43, 43, 43, 0.5) !important;
}


/* Dropdown Items */

.tools-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.25rem;
    width: 100%;
    min-width: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--kurogane) !important;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: left;
    position: relative;
    box-sizing: border-box;
}

.tools-dropdown-item:hover {
    background: rgba(149, 175, 192, 0.15) !important;
    color: var(--aitetsu) !important;
}

.tools-dropdown-item i {
    width: 16px;
    height: 16px;
    color: var(--aitetsu);
    flex-shrink: 0;
}

.tools-dropdown-item:hover i {
    color: var(--sei);
}

.tools-item-shortcut {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--buyer-text-subtle);
    background: var(--buyer-bg-tertiary);
    padding: 0.1rem 0.4rem;
    border-radius: 0 !important;
    border: 1px solid var(--buyer-border-light);
}

.tools-item-badge {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    color: white;
    background: var(--aitetsu);
    padding: 0.35rem 0.5rem;
    border-radius: 0 !important;
    min-width: 32px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tools-currency-active {
    background: var(--aitetsu);
}

.tools-expand-icon {
    width: 14px !important;
    height: 14px !important;
    color: var(--buyer-text-subtle) !important;
    margin-left: 0;
    position: absolute;
    right: 1.25rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.tools-currency-select.expanded .tools-expand-icon {
    transform: rotate(90deg);
    color: var(--buyer-accent) !important;
}


/* Dividers */

.tools-dropdown-divider {
    height: 1px;
    background: rgba(149, 175, 192, 0.2) !important;
    margin: 0.15rem 1.25rem;
}


/* Currency Submenu */

.tools-currency-submenu {
    display: none;
    padding: 0.4rem 0.75rem 0.75rem;
    animation: toolsSlideDown 0.25s ease;
}

.tools-currency-submenu.show {
    display: block;
}

@keyframes toolsSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Currency Grid */

.tools-currency-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.tools-currency-grid .currency-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    background: rgba(149, 175, 192, 0.05);
    border: 1.5px solid rgba(149, 175, 192, 0.2);
    border-radius: 0 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tools-currency-grid .currency-grid-item:hover {
    background: rgba(149, 175, 192, 0.15);
    border-color: var(--sei);
    transform: translateY(-1px);
}

.tools-currency-grid .currency-grid-item.active {
    background: var(--aitetsu);
    border-color: var(--aitetsu);
}

.tools-currency-grid .currency-grid-item .currency-flag {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* ORIGINAL price option uses $ icon instead of country flag */
.currency-flag-original {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--buyer-text-primary);
}

.tools-currency-grid .currency-grid-item .currency-code {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--kurogane);
}

.tools-currency-grid .currency-grid-item.active .currency-code {
    color: white;
}

.tools-currency-grid .currency-grid-item.original-item {
    grid-column: span 4;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: 4px;
    background: rgba(64, 84, 94, 0.05);
    border: 1px dashed var(--buyer-border);
}

.tools-currency-grid .currency-grid-item.original-item:hover {
    background: rgba(64, 84, 94, 0.1);
    border-color: rgba(64, 84, 94, 0.3);
}

.tools-currency-grid .currency-grid-item.original-item.active {
    background: var(--buyer-accent);
    border-style: solid;
    border-color: var(--buyer-accent);
}

.tools-currency-grid .currency-grid-item.original-item .original-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--buyer-text-primary);
}

.tools-currency-grid .currency-grid-item.original-item.active .original-text {
    color: #ffffff;
}


/* Language Grid */

.tools-language-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3px;
    padding: 0.2rem 0.75rem 0.6rem;
}


/* Expanded language grid for 15+ languages */

.tools-language-grid-expanded {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 280px;
    overflow-y: auto;
    padding: 0.4rem 0.75rem 0.6rem;
    gap: 4px;
}

.tools-language-grid-expanded::-webkit-scrollbar {
    width: 4px;
}

.tools-language-grid-expanded::-webkit-scrollbar-track {
    background: transparent;
}

.tools-language-grid-expanded::-webkit-scrollbar-thumb {
    background: var(--buyer-border);
    border-radius: 0 !important;
}

.tools-language-grid-expanded .tools-lang-option {
    padding: 0.4rem 0.5rem;
    font-size: 0.72rem;
    min-width: 0;
    align-items: flex-start;
}

.tools-language-grid-expanded .tools-lang-option .lang-flag {
    font-size: 0.7rem;
}

.tools-language-grid-expanded .tools-lang-option .lang-name {
    font-size: 0.72rem;
    white-space: normal;
    min-width: 0;
    /* Use system fonts so Cyrillic/Russian/Ukrainian render correctly when document lang is ja/zh */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: normal;
    word-spacing: normal;
}

.tools-lang-option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.6rem;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 0 !important;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--kurogane) !important;
    transition: background 0.15s ease, color 0.15s ease;
    width: 100%;
    min-width: 0;
    text-align: left;
}

.tools-lang-option:hover {
    background: rgba(149, 175, 192, 0.15) !important;
    border-color: transparent;
    color: var(--aitetsu) !important;
}

.tools-lang-option.active {
    background: var(--aitetsu) !important;
    color: white !important;
    border-color: transparent;
    font-weight: 600;
}

.tools-lang-option.active .lang-name {
    color: white !important;
    font-weight: 600;
}

.tools-lang-option.active .lang-flag {
    filter: none;
}

.tools-lang-option .lang-flag {
    font-size: 0.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.tools-lang-option .lang-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--namari);
    /* Use system fonts so Cyrillic/Russian/Ukrainian render correctly when document lang is ja/zh */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: normal;
    word-spacing: normal;
}

.tools-lang-option:hover .lang-name {
    color: var(--aitetsu);
}

.tools-lang-option.active:hover .lang-name {
    color: #2B2B2B !important;
}


/* Scrollbar for dropdown */

.tools-dropdown-menu::-webkit-scrollbar {
    width: 4px;
}

.tools-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.tools-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--buyer-border);
    border-radius: 0 !important;
}


/* Mobile responsive: keep dropdown inside viewport */
@media (max-width: 768px) {
    .tools-dropdown-menu {
        position: fixed !important;
        left: 1rem !important;
        right: 1rem !important;
        width: auto !important;
        max-width: none !important;
        top: auto !important;
        bottom: 5.5rem !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .tools-dropdown-menu.show {
        transform: translateY(0) scale(1) !important;
    }

    .tools-dropdown-arrow {
        display: none !important;
    }

    .tools-language-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tools-language-grid-expanded {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 240px;
    }

    .tools-dropdown-menu .tools-dropdown-item,
    .tools-dropdown-menu .tools-section-label,
    .tools-dropdown-menu .tools-lang-option {
        min-width: 0;
    }

    .tools-dropdown-menu .tools-lang-option .lang-name {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .tools-dropdown-menu {
        position: fixed;
        top: 70px;
        right: 0;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 80px);
        border-radius: 0 !important;
    }

    .tools-dropdown-arrow {
        display: none;
    }

    .tools-language-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .tools-language-grid-expanded {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 200px;
    }

    .tools-language-grid-expanded .tools-lang-option {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }

    .tools-language-grid-expanded .tools-lang-option .lang-name {
        font-size: 0.75rem;
    }
}


/* Hide old standalone elements that are now in the dropdown */

.language-selector {
    display: none !important;
}

.preferred-currency-dropdown:not(.tools-currency-submenu .preferred-currency-dropdown) {
    display: none !important;
}


/* ====================================
   ICON UTILITY CLASSES
   For RTL/LTR compatibility
   ==================================== */


/* Navigation Icon */

.nav-icon-search {
    width: 15px;
    height: 15px;
    margin-right: 6px;
    opacity: 0.8;
}


/* Summary Icons */

.summary-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.summary-icon-small {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: middle;
}


/* ====================================
   SCROLL-TO-TOP — Always above footer
   Fix: button must stay visible when scrolling
   ==================================== */

.footer {
    position: relative;
    z-index: 1;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Ensure footer inner content is centered and aligned */
.footer .footer-nav {
    width: 100%;
    box-sizing: border-box;
}

.footer .footer-copyright-bar {
    box-sizing: border-box;
}

.scroll-top-fixed {
    z-index: 10002 !important;
    position: fixed !important;
}


/* ====================================
   BUYER MOBILE MENU — Drawer (no blur, no gold line)
   Migrated from buyer-mobile-menu.css; fixed overlay so it never disappears on scroll
   ==================================== */

/* Drawer header (title + X) only visible in mobile drawer */
.nav-links-drawer-header {
    display: none;
}

/* Overlay and backdrop sit below navbar so dark layer is only behind/beside the drawer */
.buyer-mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
    overflow: hidden;
    transition: visibility 0s linear 0.3s;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

.buyer-mobile-menu-overlay.open {
    pointer-events: auto;
    visibility: visible;
    overflow: hidden;
    transition: visibility 0s linear 0s;
}

/* Backdrop: solid dark overlay, no blur (override styles.css) */
.buyer-mobile-menu-overlay .mobile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(43, 43, 43, 0.55);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.buyer-mobile-menu-overlay.open .mobile-backdrop.active {
    opacity: 1;
    visibility: visible;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* When menu is open: no blur anywhere, drawer and content visible (override any other sheet) */
body.mobile-menu-open .buyer-mobile-menu-overlay .mobile-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.mobile-menu-open #navLinks.nav-links.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
}

body.mobile-menu-open #navLinks .nav-link,
body.mobile-menu-open #navLinks .nav-dropdown,
body.mobile-menu-open #navLinks .nav-dropdown .dropdown-trigger {
    opacity: 1 !important;
    visibility: visible !important;
}

/* When drawer is open, hide the top hamburger (use only X in drawer to close) */
body.mobile-menu-open .mobile-menu-btn {
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 992px) {

    /* Drawer panel: no edges, no border radius */
    #navLinks.nav-links {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: auto !important;
        width: min(320px, 88vw) !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-direction: column !important;
        background: #ffffff !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        transform: translateX(100%) !important;
        opacity: 1 !important;
        visibility: visible !important;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
        z-index: 10001 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border: none !important;
    }

    #navLinks.nav-links.active {
        transform: translateX(0) !important;
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Ensure all sidebar content is visible */
    #navLinks .nav-link,
    #navLinks .nav-dropdown,
    #navLinks .nav-dropdown .dropdown-trigger {
        opacity: 1 !important;
        visibility: visible !important;
    }

    #navLinks .nav-link,
    #navLinks .nav-dropdown .dropdown-trigger {
        white-space: normal !important;
    }

    /* Drawer header: no decorative strip */
    #navLinks::before {
        display: none !important;
    }

    .nav-links-drawer-header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding: 0.75rem 1.25rem !important;
        min-height: 48px !important;
        flex-shrink: 0;
        border-bottom: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
    }

    #navLinks .nav-links-drawer-close {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background: var(--kurogane, #2B2B2B) !important;
        color: #ffffff !important;
        cursor: pointer !important;
        transition: background 0.2s ease, color 0.2s ease !important;
    }

    #navLinks .nav-links-drawer-close:hover {
        background: var(--sei, #95AFC0) !important;
        color: #ffffff !important;
    }

    #navLinks .nav-links-drawer-close i {
        width: 20px !important;
        height: 20px !important;
    }

    /* Plain links (Search Parts, About Us, etc.): left-aligned icon + text, same as other items */
    /* Drawer links: brand text color, sei (grey) hover/focus like landing page */
    #navLinks a.nav-link {
        width: 100% !important;
        padding: 0.875rem 1.25rem !important;
        margin: 0 !important;
        font-size: 0.9375rem !important;
        font-weight: 600 !important;
        color: var(--kurogane, #2B2B2B) !important;
        background: #ffffff !important;
        border: none !important;
        border-radius: 0 !important;
        text-align: left !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.75rem !important;
        min-height: 48px !important;
        transition: background 0.2s ease, color 0.2s ease !important;
        border-bottom: 1px solid #e8ecf0 !important;
    }

    #navLinks a.nav-link:hover {
        background: rgba(149, 175, 192, 0.12) !important;
        color: var(--sei, #95AFC0) !important;
    }

    #navLinks a.nav-link.active {
        background: rgba(149, 175, 192, 0.12) !important;
        color: var(--sei, #95AFC0) !important;
    }

    /* Dropdown wrapper: full width, no extra padding/margin so it aligns with other tabs */
    #navLinks .nav-dropdown {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Dropdown triggers (Account, Support): same alignment and padding as other drawer links */
    #navLinks .nav-dropdown .dropdown-trigger {
        width: 100% !important;
        padding: 0.875rem 1.25rem !important;
        margin: 0 !important;
        font-size: 0.9375rem !important;
        font-weight: 600 !important;
        color: var(--kurogane, #2B2B2B) !important;
        background: #ffffff !important;
        border: none !important;
        border-radius: 0 !important;
        text-align: left !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.75rem !important;
        min-height: 48px !important;
        transition: background 0.2s ease, color 0.2s ease !important;
        border-bottom: 1px solid #e8ecf0 !important;
        box-sizing: border-box !important;
    }

    /* Chevron stays on the right; label stays left-aligned like other tabs */
    #navLinks .nav-dropdown .dropdown-trigger .dropdown-chevron {
        margin-left: auto !important;
    }

    #navLinks .nav-dropdown .dropdown-trigger:hover {
        background: rgba(149, 175, 192, 0.12) !important;
        color: var(--sei, #95AFC0) !important;
    }

    /* No underline accent in drawer */
    #navLinks .nav-link::after {
        display: none !important;
    }

    #navLinks .dropdown-chevron {
        width: 18px !important;
        height: 18px !important;
        color: var(--kurogane, #2B2B2B) !important;
        transition: transform 0.25s ease !important;
    }

    #navLinks .nav-dropdown.open .dropdown-chevron {
        transform: rotate(180deg) !important;
        color: var(--sei, #95AFC0) !important;
    }

    #navLinks .nav-dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        min-width: unset !important;
        margin: 0 !important;
        padding: 0 0 0 1.25rem !important;
        background: #fafbfc !important;
        display: none !important;
        overflow: hidden !important;
        border-left: 3px solid var(--sei, #95AFC0) !important;
    }

    #navLinks .nav-dropdown.open .nav-dropdown-menu {
        display: block !important;
    }

    #navLinks .nav-dropdown-item {
        padding: 0.65rem 1rem !important;
        gap: 0.75rem !important;
        font-size: 0.875rem !important;
        color: var(--kurogane, #2B2B2B) !important;
        border-radius: 0 !important;
        min-height: 40px !important;
        border-bottom: 1px solid #e8ecf0 !important;
        background: #ffffff !important;
    }

    #navLinks .nav-dropdown-item:hover {
        background: rgba(149, 175, 192, 0.1) !important;
        color: var(--sei, #95AFC0) !important;
    }

    #navLinks .nav-dropdown-item i {
        width: 18px !important;
        height: 18px !important;
        color: var(--sei, #95AFC0) !important;
    }

    #navLinks .dropdown-item-title {
        font-weight: 600 !important;
        font-size: 0.875rem !important;
        color: var(--kurogane, #2B2B2B) !important;
    }

    /* Hide subtitles (e.g. "Manage payment methods") in drawer — title only */
    #navLinks .dropdown-item-desc {
        display: none !important;
    }
}

@media (max-width: 768px) {

    /* Bottom bar: brand dark bar with sei (grey) accents like landing page */
    #navActions {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0.75rem 1rem !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 1rem !important;
        background: var(--kurogane, #2B2B2B) !important;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2) !important;
        border-top: 1px solid rgba(149, 175, 192, 0.25) !important;
        transform: translateY(100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease, visibility 0.25s ease !important;
        z-index: 99998 !important;
    }

    #navActions.active {
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    #navActions .btn-cart,
    #navActions .btn-tools-hamburger {
        color: rgba(255, 255, 255, 0.9) !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 50% !important;
        padding: 0 !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        align-items: center !important;
        justify-content: center !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    #navActions .btn-cart:hover,
    #navActions .btn-tools-hamburger:hover {
        background: rgba(149, 175, 192, 0.25) !important;
        color: var(--sei, #95AFC0) !important;
        border-radius: 50% !important;
    }

    #navActions .cart-badge {
        background: var(--sei, #95AFC0) !important;
        color: var(--kurogane, #2B2B2B) !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        border-radius: 9999px !important;
    }

    #navActions .user-profile-btn.user-profile-btn-compact,
    #navActions .user-avatar {
        color: rgba(255, 255, 255, 0.9) !important;
        border-radius: 50% !important;
        overflow: hidden !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    #navActions .user-profile-btn.user-profile-btn-compact {
        background: rgba(255, 255, 255, 0.1) !important;
        border: none !important;
        width: 42px !important;
        height: 42px !important;
        padding: 0 !important;
    }

    #navActions .user-profile-btn.user-profile-btn-compact:hover {
        background: rgba(149, 175, 192, 0.2) !important;
    }

    #navActions .user-profile-btn.user-profile-btn-compact:focus,
    #navActions .user-profile-btn.user-profile-btn-compact:focus-visible {
        outline: none !important;
        box-shadow: 0 0 0 2px var(--sei, #95AFC0) !important;
    }

    #navActions .user-profile-btn:hover .user-avatar,
    #navActions .user-avatar:hover {
        background: rgba(149, 175, 192, 0.25) !important;
        color: var(--sei, #95AFC0) !important;
    }

    /* Tools dropdown: open ABOVE the bottom bar so it’s visible */
    #navActions .nav-tools-wrapper {
        position: relative !important;
    }

    #navActions .tools-dropdown-menu {
        position: fixed !important;
        left: 1rem !important;
        right: 1rem !important;
        bottom: 5.5rem !important;
        top: auto !important;
        width: auto !important;
        max-width: none !important;
        max-height: 70vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: translateY(8px) scale(0.98) !important;
        z-index: 100002 !important;
        box-sizing: border-box !important;
    }

    #navActions .tools-dropdown-menu.show {
        transform: translateY(0) scale(1) !important;
    }

    #navActions .tools-dropdown-arrow {
        display: none !important;
    }

    /* Profile dropdown: open ABOVE the bottom bar so it’s visible */
    #navActions .user-profile-dropdown {
        position: relative !important;
    }

    #navActions .user-dropdown-menu {
        position: absolute !important;
        top: auto !important;
        bottom: calc(100% + 10px) !important;
        right: 0 !important;
        left: auto !important;
        min-width: 220px !important;
        transform: translateY(8px) !important;
        z-index: 100002 !important;
    }

    #navActions .user-dropdown-menu.show {
        transform: translateY(0) !important;
    }

    #navLinks {
        padding-bottom: 80px !important;
    }
}