/* =========================================================
   STOREFRONT LAYOUT — top nav, no sidebar
   ========================================================= */

.customer-layout {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    width: 100%;
    background: var(--background);
}

/* ---------- Sticky store header ---------- */

.store-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.store-header-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    min-height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.store-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--text);
}

.store-brand:hover {
    color: var(--text);
    opacity: 0.92;
}

.store-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.28);
}

.store-brand-name {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.store-brand-tag {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Nav links */

.store-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.store-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.store-nav-link:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.store-nav-link.active {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Header search */

.store-search {
    flex: 1;
    max-width: 520px;
    position: relative;
    min-width: 0;
}

.store-search input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full, 999px);
    border-radius: 999px;
    background: var(--background);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.store-search input::placeholder {
    color: var(--text-muted);
}

.store-search input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.store-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Actions */

.store-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

.store-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.store-icon-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--primary);
}

.store-icon-btn:active {
    transform: scale(0.97);
}

.store-icon-btn svg {
    width: 20px;
    height: 20px;
}

.store-icon-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* Avatar menu */

.store-avatar-wrap {
    position: relative;
}

.store-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    font: inherit;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.store-avatar-btn:hover,
.store-avatar-btn[aria-expanded="true"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.store-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(145deg, var(--primary), var(--primary-hover));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.store-avatar-img {
    display: block;
}

.store-avatar-meta {
    text-align: left;
    min-width: 0;
    max-width: 140px;
}

.store-avatar-name {
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-avatar-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.store-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.store-avatar-btn[aria-expanded="true"] .store-chevron {
    transform: rotate(180deg);
}

.store-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    animation: storeDropdownIn 0.16s ease;
}

@keyframes storeDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.store-dropdown-label {
    padding: 8px 12px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.store-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.store-dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.store-dropdown-item.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.store-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.store-dropdown-divider {
    height: 1px;
    margin: 6px 8px;
    background: var(--border);
}

.store-dropdown-item.danger {
    color: var(--danger);
}

.store-dropdown-item.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.store-backdrop {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: transparent;
}

/* ---------- Main content ---------- */

.customer-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.customer-content {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 28px 24px 48px;
    box-sizing: border-box;
    animation: pageFadeIn 280ms ease;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.product-card,
.store-product-card {
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.product-variant-option {
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.product-variant-option.active {
    transform: scale(1.03);
}

.customer-content.is-home {
    max-width: none;
    padding: 0;
}

/* Mobile menu toggle */

.store-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.store-mobile-panel {
    display: none;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 12px 24px 16px;
}

.store-mobile-panel.open {
    display: block;
}

.store-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.store-mobile-search input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--background);
    color: var(--text);
}

/* ---------- Footer ---------- */

.store-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 28px 24px;
    margin-top: auto;
}

.store-footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.store-footer strong {
    color: var(--text);
    font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .store-nav,
    .store-search,
    .store-avatar-meta,
    .store-brand-tag {
        display: none;
    }

    .store-menu-toggle {
        display: inline-flex;
    }

    .store-header-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .customer-content {
        padding: 20px 16px 40px;
    }
}

@media (max-width: 480px) {
    .store-avatar-btn {
        padding: 3px;
    }

    .store-chevron {
        display: none;
    }

    .store-dropdown {
        right: -8px;
        width: min(260px, calc(100vw - 24px));
    }
}

/* Legacy MainLayout stubs (unused by customer pages) */
.app-layout { display: block; min-height: 100dvh; background: var(--background); }
.app-sidebar, .sidebar-brand, .sidebar-nav, .sidebar-footer { display: none !important; }
.app-main { margin-left: 0; }
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.app-content { padding: 24px; max-width: var(--content-max); margin: 0 auto; }
