﻿/* ─────────────────────────────────────────────────────────
   BlackStore — Layout CSS v2
   Covers: navbar, subnav, footer, toasts, global buttons
   ───────────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.bs-nav {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid #e8e8ed;
    position: sticky;
    top: 0;
    z-index: 100;
}

.bs-nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ── LOGO ───────────────────────────────────────────────── */
.bs-nav__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

    .bs-nav__logo:hover {
        text-decoration: none;
    }

.bs-nav__logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: block;
    flex-shrink: 0;
}

.bs-nav__logo-text {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    letter-spacing: -0.3px;
}

    .bs-nav__logo-text span {
        color: #6e6e73;
        font-weight: 400;
    }

/* ── SEARCH ─────────────────────────────────────────────── */
.bs-nav__search {
    flex: 1;
    max-width: 340px;
    background: #f5f5f7;
    border: 0.5px solid #e8e8ed;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 34px;
    color: #aeaeb2;
    transition: border-color 0.15s;
}

    .bs-nav__search:focus-within {
        border-color: #0071e3;
        background: #fff;
    }

.bs-nav__search-input {
    border: none;
    background: transparent;
    font-size: 13px;
    color: #1d1d1f;
    outline: none;
    flex: 1;
    font-family: inherit;
}

    .bs-nav__search-input::placeholder {
        color: #aeaeb2;
    }

/* ── ACTIONS ────────────────────────────────────────────── */
.bs-nav__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.bs-nav__cart {
    color: #3a3a3c;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
}

    .bs-nav__cart:hover {
        background: #f5f5f7;
        color: #1d1d1f;
    }

.bs-nav__user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bs-nav__username {
    font-size: 13px;
    color: #6e6e73;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bs-nav__logout {
    font-size: 13px;
    color: #0071e3;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

    .bs-nav__logout:hover {
        text-decoration: underline;
    }

.bs-nav__link {
    font-size: 13px;
    color: #3a3a3c;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.15s;
}

    .bs-nav__link:hover {
        background: #f5f5f7;
        color: #1d1d1f;
        text-decoration: none;
    }

.bs-nav__btn {
    font-size: 13px;
    font-weight: 500;
    background: #1d1d1f;
    color: #fff;
    border-radius: 20px;
    padding: 7px 16px;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}

    .bs-nav__btn:hover {
        background: #3a3a3c;
        color: #fff;
        text-decoration: none;
    }

/* ── SUBNAV ─────────────────────────────────────────────── */
.bs-subnav {
    border-top: 0.5px solid #f0f0f0;
    background: rgba(255,255,255,0.92);
}

.bs-subnav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

    .bs-subnav__inner::-webkit-scrollbar {
        display: none;
    }

.bs-subnav__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    color: #6e6e73;
    text-decoration: none;
    padding: 0 10px;
    height: 100%;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    cursor: pointer;
}

    .bs-subnav__item:hover {
        color: #1d1d1f;
        text-decoration: none;
    }

    .bs-subnav__item.active {
        color: #1d1d1f;
        border-bottom-color: #1d1d1f;
        font-weight: 500;
    }

.bs-subnav__sep {
    width: 0.5px;
    height: 16px;
    background: #e8e8ed;
    margin: 0 6px;
    flex-shrink: 0;
}

/* ── HAMBURGER ──────────────────────────────────────────── */
.bs-nav__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

    .bs-nav__hamburger:active {
        background: #f5f5f7;
    }

    .bs-nav__hamburger span {
        display: block;
        width: 22px;
        height: 1.5px;
        background: #1d1d1f;
        border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
    }

.bs-nav__hamburger--open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.bs-nav__hamburger--open span:nth-child(2) {
    opacity: 0;
}

.bs-nav__hamburger--open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ── MOBILE MENU ────────────────────────────────────────── */
.bs-nav__mobile {
    display: none;
    flex-direction: column;
    background: #fff;
    border-top: 0.5px solid #e8e8ed;
    padding: 8px 0 12px;
}

.bs-nav__mobile--open {
    display: flex;
}

.bs-nav__mobile-link {
    font-size: 16px;
    color: #1d1d1f;
    text-decoration: none;
    padding: 14px 24px;
    border-bottom: 0.5px solid #f0f0f0;
    transition: background 0.1s;
}

    .bs-nav__mobile-link:hover {
        background: #f5f5f7;
        text-decoration: none;
        color: #1d1d1f;
    }

/* ── MAIN ───────────────────────────────────────────────── */
.bs-main {
    flex: 1;
    padding: 32px 0 48px;
}

.bs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── TOASTS ─────────────────────────────────────────────── */
.bs-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
    animation: toast-in 0.2s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.bs-toast--success {
    background: #e6f4ea;
    color: #1a7f37;
    border: 0.5px solid #b7dfbf;
}

.bs-toast--error {
    background: #ffeef0;
    color: #cf222e;
    border: 0.5px solid #ffb8c8;
}

.bs-toast__close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

    .bs-toast__close:hover {
        opacity: 1;
    }

/* ── FOOTER ─────────────────────────────────────────────── */
.bs-footer {
    background: #fff;
    border-top: 0.5px solid #e8e8ed;
    padding: 20px 0;
}

.bs-footer__inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bs-footer__logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.bs-footer__logo-mark {
    width: 20px;
    height: 20px;
    background: #1d1d1f;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bs-footer__copy {
    font-size: 12px;
    color: #aeaeb2;
    flex: 1;
}

.bs-footer__link {
    font-size: 12px;
    color: #6e6e73;
    text-decoration: none;
}

    .bs-footer__link:hover {
        text-decoration: underline;
    }

/* ── GLOBAL BUTTONS ─────────────────────────────────────── */
.ps-btn {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-align: center;
    white-space: nowrap;
    font-family: inherit;
}

.ps-btn--primary {
    background: #0071e3;
    color: #fff !important;
}

    .ps-btn--primary:hover {
        background: #0077ed;
        color: #fff !important;
        text-decoration: none;
    }

    .ps-btn--primary:disabled {
        background: #aeaeb2;
        cursor: not-allowed;
    }

.ps-btn--outline {
    background: transparent;
    color: #0071e3;
    border: 1px solid #0071e3;
}

    .ps-btn--outline:hover {
        background: #0071e3;
        color: #fff;
        text-decoration: none;
    }

.ps-btn--ghost {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid #e8e8ed;
}

    .ps-btn--ghost:hover {
        background: #e8e8ed;
        color: #1d1d1f;
        text-decoration: none;
    }

.ps-btn--danger {
    background: transparent;
    color: #ff3b30;
    border: 1px solid #ff3b30;
}

    .ps-btn--danger:hover {
        background: #ff3b30;
        color: #fff;
        text-decoration: none;
    }

.ps-btn--full {
    width: 100%;
    display: block;
}

/* ── GLOBAL FIELDS ──────────────────────────────────────── */
.ps-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ps-field__label {
    font-size: 13px;
    font-weight: 500;
    color: #3a3a3c;
}

.ps-field__input {
    font-size: 14px;
    color: #1d1d1f;
    background: #fff;
    border: 1px solid #e8e8ed;
    border-radius: 8px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    font-family: inherit;
}

    .ps-field__input:focus {
        border-color: #0071e3;
        box-shadow: 0 0 0 3px rgba(0,113,227,0.1);
    }

.ps-field__error {
    font-size: 12px;
    color: #ff3b30;
}

.ps-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── BREADCRUMB ─────────────────────────────────────────── */
.ps-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    font-size: 13px;
}

.ps-breadcrumb__link {
    color: #0071e3;
    text-decoration: none;
}

    .ps-breadcrumb__link:hover {
        text-decoration: underline;
    }

.ps-breadcrumb__sep {
    color: #aeaeb2;
}

.ps-breadcrumb__current {
    color: #6e6e73;
}

/* ── LANGUAGE DROPDOWN ──────────────────────────────────── */
.bs-lang-drop {
    position: relative;
}

.bs-lang-drop__btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #3a3a3c;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    font-family: inherit;
    transition: background 0.15s;
}

    .bs-lang-drop__btn:hover {
        background: #f5f5f7;
    }

.bs-lang-drop__menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 0.5px solid #e8e8ed;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-width: 120px;
    z-index: 200;
    overflow: hidden;
    padding: 4px;
}

    .bs-lang-drop__menu.open {
        display: block;
    }

.bs-lang-drop__item {
    display: block;
    font-size: 13px;
    color: #1d1d1f;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 7px;
    transition: background 0.1s;
}

    .bs-lang-drop__item:hover {
        background: #f5f5f7;
        text-decoration: none;
        color: #1d1d1f;
    }

.bs-lang-drop--mobile {
    padding: 8px 24px;
}

.bs-lang-drop__menu--mobile {
    position: static;
    box-shadow: none;
    border: 0.5px solid #e8e8ed;
    margin-top: 4px;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Header wraps to two rows: logo/cart/hamburger on top,
       full-width search bar underneath — both stay reachable
       instead of disappearing into the hamburger menu. */
    .bs-nav__inner {
        flex-wrap: wrap;
        height: auto;
        min-height: 52px;
        padding: 8px 16px;
        row-gap: 8px;
    }

    .bs-nav__logo {
        order: 1;
    }

    .bs-nav__actions {
        order: 2;
        margin-left: auto;
        gap: 4px;
    }

    /* Only the cart stays in the top row; language switcher,
       login/username, etc. move into the hamburger menu. */
    .bs-nav__actions > .bs-lang-drop,
    .bs-nav__actions > .bs-nav__user,
    .bs-nav__actions > .bs-nav__link,
    .bs-nav__actions > .bs-nav__btn {
        display: none;
    }

    .bs-nav__cart {
        padding: 8px;
    }

    .bs-nav__hamburger {
        display: flex;
        order: 3;
    }

    .bs-nav__search {
        display: flex;
        order: 4;
        flex-basis: 100%;
        max-width: 100%;
        height: 40px;
    }

    .bs-nav__search-input {
        font-size: 16px; /* prevents iOS auto-zoom on focus */
    }

    .bs-main {
        padding: 20px 0 32px;
    }

    .bs-container {
        padding: 0 16px;
    }

    .ps-field-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Category sub-nav stays visible as a horizontally
       scrollable strip instead of vanishing on mobile. */
    .bs-subnav__inner {
        padding: 0 16px;
        height: 42px;
        gap: 4px;
    }

    .bs-subnav__item {
        font-size: 13px;
        padding: 0 12px;
    }
}
