/* eMax Store — shop inside main app layout */

:root {
    --store-primary: #2874f0;
    --store-primary-dark: #1c5fc7;
    --store-accent: #ff9f00;
    --store-green: #26a541;
    --store-bg: #f1f3f6;
    --store-card: #ffffff;
    --store-border: #e0e0e0;
    --store-text: #212121;
    --store-muted: #878787;
    --store-radius: 12px;
}

/* Cart badge in app header */
#storeCartBtn .store-cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e53935;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.store-shop {
    width: 100%;
    margin-top: 12px;
}

.store-search-form {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 4px;
    padding: 4px 4px 4px 14px;
    max-width: none;
    min-width: 0;
}

.store-search-icon {
    color: var(--store-muted);
    font-size: 1.1rem;
    margin-right: 8px;
    flex-shrink: 0;
}

.store-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    min-width: 0;
    background: transparent;
}

.store-search-btn {
    border: none;
    background: var(--store-accent);
    color: #fff;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 2px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.store-search-form--inline {
    flex: 1 1 220px;
    max-width: 360px;
    border: 1px solid var(--store-border);
}

.store-search-form--header {
    width: min(520px, 48vw);
    min-width: 260px;
    border: 1px solid var(--store-border);
    flex-shrink: 1;
}

@media (max-width: 767.98px) {
    .store-search-form--header {
        width: min(280px, 58vw);
        min-width: 180px;
        padding-left: 10px;
    }

    .store-search-form--header .store-search-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

.store-search-form--inline .store-search-btn,
.store-search-form--header .store-search-btn {
    border-radius: 4px;
}

.store-chip-row {
    margin-bottom: 10px;
    max-width: 100%;
    overflow: hidden;
}

.store-chip-row-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--store-muted);
    margin-bottom: 6px;
}

.store-category-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #b0b0b0 #f0f0f0;
}

.store-category-scroll::-webkit-scrollbar {
    height: 6px;
}

.store-category-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.store-category-scroll::-webkit-scrollbar-thumb {
    background: #b0b0b0;
    border-radius: 4px;
}

.store-category-scroll::-webkit-scrollbar-thumb:hover {
    background: #909090;
}

.store-cat-chip {
    flex-shrink: 0;
    border: 1px solid var(--store-border);
    background: #fff;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.store-cat-chip:hover,
.store-cat-chip.active {
    border-color: var(--store-primary);
    color: var(--store-primary);
    background: #e8f0fe;
}

.store-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

@media (min-width: 992px) {
    .store-toolbar {
        flex-shrink: 0;
        margin-bottom: 12px;
    }
}

.store-main-panel {
    width: 100%;
}

.store-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.store-page-subtitle {
    margin: 0;
    color: var(--store-muted);
    font-size: 0.875rem;
}

.store-sort-select {
    width: auto;
    min-width: 160px;
}

/* Filters in app sidebar — below Shop menu */
.store-nav-filters {
    margin-top: 8px;
    padding: 0 12px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.store-nav-filters .menu-title {
    margin-top: 12px;
}

.store-nav-filters .store-filter-section {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.store-nav-filters .store-filter-section:last-child {
    border-bottom: none;
}

.store-nav-filters .store-filter-label {
    font-size: 0.72rem;
    margin-bottom: 6px;
}

.store-nav-filters .store-cascade-list,
.store-nav-filters .store-filter-list {
    max-height: 180px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.store-nav-filters .store-cascade-list::-webkit-scrollbar,
.store-nav-filters .store-filter-list::-webkit-scrollbar {
    width: 5px;
}

.store-nav-filters .store-cascade-list::-webkit-scrollbar-thumb,
.store-nav-filters .store-filter-list::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.store-nav-filters .store-cascade-item {
    padding: 6px 8px;
    font-size: 0.8rem;
}

.store-nav-filters .store-filter-list label {
    font-size: 0.8rem;
}

[data-theme="dark"] .store-nav-filters,
.dark-theme .store-nav-filters {
    border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .store-nav-filters .store-filter-section,
.dark-theme .store-nav-filters .store-filter-section {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Sidebar filters (mobile drawer + legacy) */
.store-filter-card {
    background: var(--store-card);
    border-radius: var(--store-radius);
    border: 1px solid var(--store-border);
}

@media (min-width: 992px) {
    .store-filter-card {
        min-height: min-content;
    }

    .store-filter-head {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--store-card);
    }
}

.store-filter-head {
    padding: 14px 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--store-border);
    font-size: 0.95rem;
}

.store-filter-section {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.store-filter-section:last-child {
    border-bottom: none;
}

.store-filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--store-muted);
    margin-bottom: 8px;
}

.store-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 160px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.store-filter-list::-webkit-scrollbar,
.store-cascade-list::-webkit-scrollbar {
    width: 6px;
}

.store-filter-list::-webkit-scrollbar-thumb,
.store-cascade-list::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 4px;
}

.store-filter-list::-webkit-scrollbar-thumb:hover,
.store-cascade-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.store-filter-list li {
    margin-bottom: 4px;
}

.store-filter-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    margin: 0;
    padding: 4px 0;
}

.store-filter-list input {
    accent-color: var(--store-primary);
}

/* Cascading category filters */
.store-filter-cascade .store-filter-label {
    text-transform: none;
    font-size: 0.92rem;
    color: var(--store-text);
}

.store-filter-cascade.is-locked {
    opacity: 0.72;
    background: #fafafa;
}

.store-filter-cascade .store-filter-hint {
    margin: 0;
    font-size: 0.8rem;
    color: var(--store-muted);
    padding: 6px 8px;
    background: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.store-filter-cascade .store-filter-hint i {
    margin-top: 2px;
    flex-shrink: 0;
}

.store-cascade-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 160px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.store-cascade-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    color: var(--store-text);
    transition: background 0.12s, border-color 0.12s;
    gap: 8px;
}

.store-cascade-text {
    flex: 1;
    min-width: 0;
}

.store-cascade-count {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--store-muted);
    background: #f0f0f0;
    border-radius: 10px;
    padding: 1px 7px;
}

.store-cascade-item.active .store-cascade-count {
    background: #fff;
    color: var(--store-primary);
}

.store-cascade-item i {
    font-size: 0.75rem;
    color: var(--store-muted);
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.12s;
}

.store-cascade-item:hover {
    background: #f5f8ff;
    border-color: #d0e2ff;
}

.store-cascade-item:hover i,
.store-cascade-item.active i {
    opacity: 1;
    color: var(--store-primary);
}

.store-cascade-item.active {
    background: #e8f0fe;
    border-color: var(--store-primary);
    color: var(--store-primary);
    font-weight: 600;
}

.store-filter-cascade-productCategory {
    border-left: 3px solid #c5d9fc;
    margin-left: 10px;
    padding-left: 10px;
}

.store-filter-cascade-subCategory {
    border-left: 3px solid #a8c4fa;
    margin-left: 20px;
    padding-left: 10px;
}

.store-filter-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: var(--store-card);
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.store-bc-item {
    border: none;
    background: #e8f0fe;
    color: var(--store-primary);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.store-bc-item:hover {
    background: #d0e2ff;
}

.store-bc-sep {
    color: var(--store-muted);
    user-select: none;
}

.store-bc-clear {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--store-muted);
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
}

.store-card-catpath {
    font-size: 0.72rem;
    color: var(--store-muted);
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Banner */
.store-banner {
    background: linear-gradient(90deg, #e3f2fd, #fff8e1);
    border: 1px solid #bbdefb;
    border-radius: var(--store-radius);
    padding: 12px 16px;
    font-size: 0.9rem;
}

/* Product grid */
.store-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.store-product-card {
    background: var(--store-card);
    border: 1px solid var(--store-border);
    border-radius: var(--store-radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 248px;
    transition: box-shadow 0.15s;
}

.store-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.store-card-top {
    display: flex;
    gap: 12px;
}

.store-card-media {
    position: relative;
    flex-shrink: 0;
    width: 88px;
    height: 88px;
}

.store-card-img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
}

.store-card-img--empty,
.store-card-img--fallback {
    object-fit: contain;
    background: #f5f5f5;
}

.store-mrp--struck {
    text-decoration: line-through;
    color: var(--store-muted);
    margin-right: 4px;
}

.store-discount-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--store-green);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.store-card-info {
    flex: 1;
    min-width: 0;
}

.store-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    margin: 0 0 6px;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-card-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
}

.store-price-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.8rem;
    min-height: 1.25rem;
}

.store-price-row span {
    color: var(--store-muted);
}

.store-price-row strong {
    color: var(--store-text);
}

.store-price-row .store-rate {
    color: var(--store-green);
    font-weight: 700;
}

.store-price-row .store-mrp-line {
    font-weight: 700;
    color: var(--store-text);
}

.store-price-row .store-mrp {
    font-weight: 700;
}

.store-price-row .store-mrp.store-mrp--struck {
    text-decoration: line-through;
    color: var(--store-muted);
}

.store-price-row .store-mrp-unit {
    font-weight: 400;
    color: var(--store-muted);
}

.store-price-row .store-val--na {
    color: var(--store-muted);
    font-weight: 400;
}

.store-variant-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
    align-items: flex-start;
}

.store-variant-row--empty {
    visibility: hidden;
    pointer-events: none;
}

.store-variant-chip {
    border: 1px solid var(--store-border);
    background: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    position: relative;
}

.store-variant-chip.active {
    border-color: var(--store-primary);
    background: #e8f0fe;
    color: var(--store-primary);
    font-weight: 600;
}

.store-variant-chip--out {
    opacity: 0.45;
    border-style: dashed;
}

.store-variant-chip--out.active {
    opacity: 0.65;
}

.store-variant-chip .store-chip-off {
    color: #e53935;
    font-size: 0.65rem;
    margin-left: 2px;
}

.store-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

.store-card-actions--dual .store-qty-block {
    flex: 1;
    min-width: 0;
}

.store-add-btn {
    flex: 0 0 108px;
    width: 108px;
    height: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--store-primary);
    color: var(--store-primary);
    background: #fff;
    font-weight: 600;
    font-size: 0.78rem;
    line-height: 1.1;
    padding: 0 6px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    align-self: center;
}

.store-add-btn:hover:not(:disabled) {
    background: #e8f0fe;
}

.store-unit-label {
    flex: 0 0 auto;
    min-width: 44px;
    padding: 8px 10px;
    border: 1px solid var(--store-border);
    border-radius: 6px;
    background: #f8f9fa;
    color: var(--store-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.store-unit-label--row {
    min-width: 38px;
    padding: 4px 8px;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.store-add-btn--disabled,
.store-add-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    border-color: var(--store-border);
    color: var(--store-muted);
}

.store-qty-block {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.store-qty-block.store-b2b-dual {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.store-qty-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.store-qty-row--single {
    width: 100%;
}

.store-qty-label {
    flex: 1;
    color: var(--store-muted);
    min-width: 0;
}

.store-qty-ctrl {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--store-border);
    border-radius: 6px;
    overflow: hidden;
}

.store-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f5f5f5;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.store-qty-btn:hover {
    background: #e8e8e8;
}

.store-qty-val {
    width: 36px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    border-left: 1px solid var(--store-border);
    border-right: 1px solid var(--store-border);
    line-height: 28px;
}

.store-offers {
    border-top: 1px dashed #e0e0e0;
    padding-top: 8px;
    font-size: 0.75rem;
    color: var(--store-muted);
}

.store-offer-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.store-offer-line a {
    color: var(--store-primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.store-stock-note {
    font-size: 0.72rem;
    color: var(--store-muted);
    min-height: 1rem;
}

.store-stock-note--out {
    color: #c62828;
}

.store-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--store-muted);
}

.store-empty i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Footer */
.store-footer {
    background: #172337;
    color: #aeb8c7;
    padding: 16px 0;
    margin-top: 24px;
}

.store-footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
}

.store-footer-note {
    opacity: 0.7;
}

/* Mobile filter drawer */
.store-filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(300px, 85vw);
    height: 100%;
    background: #fff;
    z-index: 1045;
    transform: translateX(-100%);
    transition: transform 0.25s;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.store-filter-drawer.open {
    transform: translateX(0);
}

.store-filter-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--store-border);
}

.store-filter-drawer-body {
    overflow-y: auto;
    flex: 1;
}

.store-offcanvas-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
}

.store-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--store-border);
    z-index: 1020;
    padding: 8px;
    gap: 8px;
}

.store-mobile-bar-btn {
    flex: 1;
    border: 1px solid var(--store-border);
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 991.98px) {
    body.store-page-active .store-shop {
        padding-bottom: 72px;
    }
}

.store-location-note {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--store-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.store-loc-btn {
    border: 1px solid var(--store-primary);
    color: var(--store-primary);
    background: #fff;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.store-loc-btn:hover {
    background: var(--store-primary);
    color: #fff;
}

.store-delivery-select {
    max-width: 180px;
}
