/* ============================================================
   SEEDHUB SHOP PAGE — F3.3
   Variables inherit from style.css (:root already defined).
   Product card classes inherit from home.css.
============================================================ */

/* ============================================================
   SHOP LAYOUT
============================================================ */

.shop-page {
    background: #f5f7f5;
    min-height: 60vh;
    padding-bottom: 60px;
}

/* ── Breadcrumb ──────────────────────────────────────────── */

.shop-breadcrumb {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.shop-breadcrumb-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.shop-breadcrumb-inner a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color .2s;
}

.shop-breadcrumb-inner a:hover {
    color: var(--primary);
}

.shop-breadcrumb-sep {
    color: #ccc;
    font-size: 11px;
}

.shop-breadcrumb-current {
    color: var(--text-dark);
    font-weight: 600;
}

/* ── Top bar (title + sort + count) ──────────────────────── */

.shop-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: var(--header-height, 82px);
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

.shop-topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.shop-topbar-left {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.shop-topbar-title {
    font-family: "Playfair Display", serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.shop-result-count {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.shop-active-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.shop-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 12px;
    background: #e8f3ec;
    color: var(--primary);
    border: 1px solid #c2deca;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.shop-filter-tag:hover {
    background: #d4ecdc;
    border-color: #a8d4b8;
}

.shop-filter-tag-x {
    font-size: 14px;
    line-height: 1;
    color: var(--primary);
    opacity: .7;
}

.shop-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Filter toggle button (mobile) */
.shop-filter-toggle {
    display: none;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.shop-filter-toggle:hover {
    background: var(--primary-dark);
}

.shop-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--secondary);
    color: #000;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
}

/* Sort select */
.shop-sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-sort-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.shop-sort-select {
    padding: 7px 32px 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color .2s;
    min-width: 160px;
}

.shop-sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Body: sidebar + grid ────────────────────────────────── */

.shop-body {
    padding-top: 24px;
}

.shop-body-inner {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

/* ============================================================
   FILTER SIDEBAR
============================================================ */

.shop-sidebar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-height, 82px) + 70px);
    max-height: calc(100vh - var(--header-height, 82px) - 90px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.shop-sidebar::-webkit-scrollbar { width: 4px; }
.shop-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.shop-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.shop-sidebar-header h3 {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.shop-clear-all {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    transition: color .2s;
}

.shop-clear-all:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Filter group */
.shop-filter-group {
    border-bottom: 1px solid var(--border-light);
}

.shop-filter-group:last-child {
    border-bottom: none;
}

.shop-filter-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    cursor: pointer;
    user-select: none;
    background: #fff;
    transition: background .15s;
}

.shop-filter-group-header:hover {
    background: #fafcfa;
}

.shop-filter-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.shop-filter-group-icon {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform .2s;
}

.shop-filter-group.open .shop-filter-group-icon {
    transform: rotate(180deg);
}

.shop-filter-group-body {
    padding: 4px 18px 14px;
    display: none;
}

.shop-filter-group.open .shop-filter-group-body {
    display: block;
}

/* Filter items: radio / checkbox */
.shop-filter-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    cursor: pointer;
}

.shop-filter-item input[type="radio"],
.shop-filter-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.shop-filter-item-label {
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    line-height: 1.3;
}

.shop-filter-item:hover .shop-filter-item-label {
    color: var(--primary);
}

/* Price inputs */
.shop-price-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.shop-price-input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    transition: border-color .2s;
    min-width: 0;
}

.shop-price-input:focus {
    outline: none;
    border-color: var(--primary);
}

.shop-price-sep {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.shop-price-apply {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.shop-price-apply:hover {
    background: var(--primary-dark);
}

/* Rating filter stars */
.shop-rating-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.shop-stars {
    color: #e6a817;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Filter loading skeleton */
.shop-filter-skeleton {
    padding: 10px 18px;
}

.shop-filter-skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.shop-filter-skeleton-line:last-child { margin-bottom: 0; }
.shop-filter-skeleton-line.short { width: 60%; }
.shop-filter-skeleton-line.medium { width: 80%; }

/* ============================================================
   PRODUCT GRID AREA
============================================================ */

.shop-grid-area {
    min-width: 0;
}

/* Product grid */
.shop-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

/* Loading skeleton cards */
.shop-skeleton-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    overflow: hidden;
}

.shop-skeleton-img {
    width: 100%;
    height: 170px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 10px;
    margin-bottom: 12px;
}

.shop-skeleton-line {
    height: 13px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.shop-skeleton-line.w-80 { width: 80%; }
.shop-skeleton-line.w-60 { width: 60%; }
.shop-skeleton-line.w-40 { width: 40%; }

.shop-skeleton-btn {
    height: 36px;
    width: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 9px;
    margin-top: 10px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state */
.shop-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.shop-empty-icon {
    font-size: 52px;
    color: #d0d8d2;
}

.shop-empty h3 {
    font-family: "DM Sans", sans-serif;
    font-size: 20px;
    color: var(--text-dark);
    margin: 0;
}

.shop-empty p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    max-width: 340px;
}

.shop-empty-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Error state */
.shop-error {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 50px 20px;
    text-align: center;
    background: #fff8f8;
    border: 1px dashed #e5a0a0;
    border-radius: var(--radius-md);
}

.shop-error-icon { font-size: 42px; color: #c0392b; opacity: .5; }
.shop-error h3 { font-family: "DM Sans", sans-serif; font-size: 18px; margin: 0; color: var(--text-dark); }
.shop-error p  { font-size: 13px; color: var(--text-muted); margin: 0; }

/* Shared action buttons */
.shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
    border: none;
    text-decoration: none;
    font-family: inherit;
}

.shop-btn-primary {
    background: var(--primary);
    color: #fff;
}

.shop-btn-primary:hover {
    background: var(--primary-dark);
}

.shop-btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.shop-btn-outline:hover {
    background: #edf7ee;
}

/* ============================================================
   PAGINATION
============================================================ */

.shop-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.shop-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
    font-family: inherit;
    text-decoration: none;
}

.shop-page-btn:hover:not(:disabled):not(.active) {
    background: #edf7ee;
    border-color: var(--primary);
    color: var(--primary);
}

.shop-page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    cursor: default;
}

.shop-page-btn:disabled,
.shop-page-btn.disabled {
    opacity: .4;
    cursor: not-allowed;
}

.shop-page-ellipsis {
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 4px;
    line-height: 38px;
}

/* ============================================================
   MOBILE FILTER DRAWER
============================================================ */

.shop-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.46);
    z-index: 400;
    opacity: 0;
    transition: opacity .3s ease;
}

.shop-drawer-overlay.visible {
    display: block;
}

.shop-drawer-overlay.open {
    opacity: 1;
}

.shop-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 92vw);
    height: 100dvh;
    background: #fff;
    z-index: 401;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s ease;
    box-shadow: 6px 0 30px rgba(0,0,0,.15);
}

.shop-drawer.open {
    transform: translateX(0);
}

.shop-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.shop-drawer-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
}

.shop-drawer-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text);
    font-size: 16px;
    transition: background .2s;
}

.shop-drawer-close:hover {
    background: #ebebeb;
}

.shop-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* drawer uses same .shop-sidebar inner elements */
.shop-drawer .shop-filter-group {
    border-bottom: 1px solid var(--border-light);
}

.shop-drawer-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    background: #fff;
}

.shop-drawer-footer .shop-btn {
    flex: 1;
    height: 44px;
}

/* ============================================================
   RESPONSIVE — TABLET  992px
============================================================ */

@media (max-width: 1200px) {
    .shop-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 992px) {
    .shop-body-inner {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        display: none; /* hidden on mobile — shown in drawer instead */
    }

    .shop-filter-toggle {
        display: flex;
    }

    .shop-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .shop-topbar-title {
        font-size: 17px;
    }
}

/* ============================================================
   RESPONSIVE — TABLET  768px
============================================================ */

@media (max-width: 768px) {
    .shop-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .shop-topbar-inner {
        gap: 10px;
    }

    .shop-sort-label {
        display: none;
    }

    .shop-sort-select {
        min-width: 130px;
        font-size: 12px;
    }

    .shop-topbar-title {
        font-size: 15px;
        max-width: 200px;
    }

    .shop-result-count {
        font-size: 12px;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE  576px
============================================================ */

@media (max-width: 576px) {
    .shop-breadcrumb {
        display: none;
    }

    .shop-topbar {
        padding: 11px 0;
    }

    .shop-topbar-inner {
        flex-wrap: nowrap;
    }

    .shop-topbar-title {
        max-width: 140px;
        font-size: 14px;
    }

    .shop-result-count {
        display: none;
    }

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

    .shop-active-filters {
        display: none; /* shown below topbar on very small screens */
    }

    .shop-pagination {
        gap: 4px;
    }

    .shop-page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 12px;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE  400px
============================================================ */

@media (max-width: 400px) {
    .shop-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .shop-topbar-title {
        max-width: 110px;
        font-size: 13px;
    }

    .shop-sort-select {
        min-width: 110px;
        font-size: 11px;
        padding: 5px 24px 5px 8px;
    }
}

/* ============================================================
   PRODUCT CARD OVERRIDES FOR SHOP GRID
   (seedhub-seed-card from home.css — minor shop-specific tweaks)
============================================================ */

/* Ensure cards fill grid cell height evenly */
.shop-product-grid .seedhub-seed-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Tighten image height slightly for 4-column grid */
.shop-product-grid .seedhub-product-image {
    height: 160px;
}

@media (max-width: 768px) {
    .shop-product-grid .seedhub-product-image {
        height: 130px;
    }
}

@media (max-width: 480px) {
    .shop-product-grid .seedhub-product-image {
        height: 110px;
    }
}
