/* ============================================================
   store.css — Individual store page styles
   ============================================================ */

/* ── Store hero ───────────────────────────────────────────── */
.store-hero {
    background: var(--hero-gradient);
    color: var(--hero-fg);
    padding: 36px 0 32px;
    position: relative;
    overflow: hidden;
}

.store-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M20 20c0-5.5-4.5-10-10-10S0 14.5 0 20s4.5 10 10 10 10-4.5 10-10zm10 0c0-5.5-4.5-10-10-10s-10 4.5-10 10 4.5 10 10 10 10-4.5 10-10z'/%3E%3C/g%3E%3C/svg%3E");
}

.store-hero-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    flex-wrap: wrap;
}

.store-hero-logo {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.store-hero-logo img {
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
}

.store-hero-initials {
    font-family: 'Poppins', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--hero-fg);
}

.store-hero-info {
    flex: 1;
    min-width: 200px;
}

.store-hero-cat {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 5px;
}

.store-hero-name {
    font-family: 'Poppins', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--hero-fg);
    margin: 0 0 6px;
    line-height: 1.2;
}

.store-hero-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 14px;
    max-width: 520px;
    line-height: 1.5;
}

.store-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sh-btn-visit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange);
    color: #fff;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
}

.sh-btn-visit:hover {
    background: var(--orange-dk);
    color: #fff;
}

.store-cache-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
}

.store-cache-badge.live {
    color: rgba(255, 255, 255, 0.6);
}

.store-cache-refresh {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    margin-left: 4px;
    font-size: 0.75rem;
}

.store-cache-refresh:hover {
    color: #fff;
}

.store-hero-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 24px;
    flex-shrink: 0;
}

.store-stat-num {
    display: block;
    font-family: 'Poppins', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.store-stat-lbl {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 4px;
}

/* ── Back link ────────────────────────────────────────────── */
.sh-back-link {
    font-size: 0.875rem;
    color: var(--brown-mid);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.15s;
}

.sh-back-link:hover {
    color: var(--orange);
}

/* ── Category tabs ────────────────────────────────────────── */
.store-cat-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid var(--border);
}

.store-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--white);
    color: var(--brown-mid);
    font-size: 0.83rem;
    font-weight: 500;
    border: 1.5px solid var(--border);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.store-cat-tab:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--orange-lt);
}

.store-cat-tab.active {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
    font-weight: 600;
}

.tab-count {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.7rem;
}

.store-cat-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Full category list — matches the pill look */
.store-cat-select {
    display: inline-flex;
    align-items: center;
    max-width: 220px;
    padding: 6px 32px 6px 14px;
    border-radius: 20px;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a97c50' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 11px;
    color: var(--brown-mid);
    font-size: 0.83rem;
    font-weight: 500;
    font-family: inherit;
    border: 1.5px solid var(--border);
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.store-cat-select:hover {
    border-color: var(--orange);
    color: var(--orange);
    background-color: var(--orange-lt);
}

.store-cat-select:focus {
    outline: none;
    border-color: var(--orange);
}

/* Combined product + category search box (JS enhances the plain GET form) */
.store-cat-picker {
    position: relative;
    display: inline-flex;
    margin: 0;
}

.store-cat-search-input {
    width: 220px;
    max-width: 100%;
    padding: 6px 14px 6px 32px;
    border-radius: 20px;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a97c50' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5L14 14'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 11px center;
    background-size: 13px;
    color: var(--brown-mid);
    font-size: 0.83rem;
    font-weight: 500;
    font-family: inherit;
    border: 1.5px solid var(--border);
    transition: border-color 0.15s;
}

.store-cat-search-input::placeholder {
    color: var(--brown-mid);
    opacity: 0.55;
    font-weight: 500;
}

.store-cat-search-input:hover {
    border-color: var(--orange);
}

.store-cat-search-input:focus {
    outline: none;
    border-color: var(--orange);
    background-color: var(--orange-lt);
}

.store-cat-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    max-width: 340px;
    max-height: 340px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

.store-cat-results li {
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.83rem;
    color: var(--brown-mid);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-cat-results li i {
    margin-right: 6px;
    opacity: 0.5;
    font-size: 0.9em;
}

.store-cat-row {
    cursor: pointer;
}

.store-cat-row.active,
.store-cat-row:hover {
    background: var(--orange-lt);
    color: var(--orange);
}

.store-cat-no-hit {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--brown-mid);
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

.store-search-clear {
    margin-left: 8px;
    color: var(--orange);
    text-decoration: underline;
    font-size: 0.82rem;
}

/* ── Product search (plain GET form, results render in the grid) ── */
.store-prod-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 4px 4px 4px 12px;
    border-radius: 20px;
    background: var(--white);
    border: 1.5px solid var(--border);
    transition: border-color 0.15s;
}

.store-prod-search:focus-within {
    border-color: var(--orange);
}

.store-prod-search > i {
    color: var(--brown-mid);
    opacity: 0.55;
    font-size: 0.9rem;
}

.store-prod-search input {
    border: none;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 0.83rem;
    color: var(--brown-mid);
    width: 190px;
    max-width: 46vw;
    padding: 4px 0;
}

.store-prod-search input::placeholder {
    color: var(--brown-mid);
    opacity: 0.55;
}

.store-prod-search button {
    border: none;
    background: var(--orange);
    color: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.store-prod-search button:hover {
    background: var(--orange-dk);
}

/* ── Toolbar ──────────────────────────────────────────────── */
.store-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.store-toolbar-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── /products filter controls ─────────────────────────────── */
.sh-prod-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sh-prod-filters select {
    font-size: 0.85rem;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    max-width: 220px;
}

.sh-instock-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
}

.store-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--warm-100);
    border-radius: 8px;
    padding: 3px;
    border: 1px solid var(--border);
}

.toggle-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s;
}

.toggle-btn.active {
    background: var(--white);
    color: var(--orange);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.toggle-btn:hover:not(.active) {
    color: var(--orange);
}

/* ── Product card grid ────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
    margin-bottom: 32px;
}

.product-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--warm-200);
    color: inherit;
    text-decoration: none;
}

.product-card-img {
    position: relative;
    background: var(--warm-100);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-card-img img {
    transform: scale(1.04);
}

.product-card-no-img {
    font-size: 3rem;
    opacity: 0.3;
}

.product-card-sale {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--orange);
    color: #fff;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.68rem;
    font-weight: 700;
}

.product-card-oos {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px;
}

.product-card-body {
    padding: 12px 14px;
    flex: 1;
}

.product-card-cat {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--orange);
    display: block;
    margin-bottom: 4px;
}

.product-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brown);
    margin: 0 0 5px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    margin-top: auto;
}

.price-was {
    text-decoration: line-through;
    color: var(--text-faint);
    font-size: 0.77rem;
    display: block;
}

.price-now {
    font-weight: 700;
    color: var(--orange);
    font-size: 1rem;
}

.price-regular {
    font-weight: 700;
    color: var(--brown);
    font-size: 1rem;
}

.price-na {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.product-card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--warm-100);
    background: var(--surface-alt);
}

.product-card-cta {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--orange);
    display: flex;
    align-items: center;
    gap: 5px;
    transition: gap 0.15s;
}

.product-card:hover .product-card-cta {
    gap: 9px;
}

/* ── Table view ───────────────────────────────────────────── */
.store-table-wrap {
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    margin-bottom: 32px;
}

.store-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--white);
}

.store-table thead th {
    background: var(--warm-100);
    padding: 11px 14px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--brown-mid);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.store-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--warm-100);
    vertical-align: middle;
}

.store-table tbody tr:last-child td {
    border-bottom: none;
}

.store-table tbody tr:hover td {
    background: var(--surface-alt);
}

/* ── Pagination ───────────────────────────────────────────── */
.store-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-bottom: 20px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .store-hero-stat {
        display: none;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .store-cat-tabs {
        gap: 4px;
    }

    .store-cat-select {
        flex: 1 1 100%;
        max-width: none;
        margin-top: 4px;
    }

    .store-cat-picker {
        flex: 1 1 100%;
        margin-top: 4px;
    }

    .store-cat-search-input {
        width: 100%;
    }

    .store-cat-results {
        left: 0;
        right: 0;
        max-width: none;
    }

    .store-prod-search {
        flex: 1 1 100%;
        margin-top: 4px;
    }

    .store-prod-search input {
        flex: 1;
        width: auto;
        max-width: none;
    }

    .col-cats,
    .col-stock {
        display: none;
    }
}

@media (max-width: 420px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .store-hero-logo {
        width: 64px;
        height: 64px;
    }

    .store-hero-name {
        font-size: 1.3rem;
    }
}