
* {
    box-sizing: border-box;
}

/* Override base template styles */
.main-content {
    padding: 0 !important;
    max-width: 100% !important;
    display: block !important;
}

@media (min-width: 1025px) {
    .main-content {
        margin-left: 260px !important;
    }
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0 !important;
    }
}

body {
    background: var(--bg-secondary);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Shop Header */
.shop-header {
    background: var(--bg-primary);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shop-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s;
}

.header-btn:hover {
    background: var(--bg-hover);
}

/* Search and Filter Container */
.search-filter-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary);
}

.search-bar::placeholder {
    color: var(--text-tertiary);
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    font-size: 1.125rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex: 0 0 auto;
    padding: 0.625rem 1rem;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-tab:hover {
    border-color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.category-icon {
    font-size: 1rem;
}

/* Products Container */
.products-container {
    padding: 1rem;
    background: var(--bg-secondary);
    min-height: calc(100vh - 200px);
    width: 100%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.see-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}

/* Horizontal Scroll Container */
.product-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.product-scroll::-webkit-scrollbar {
    display: none;
}

/* Product Card (Horizontal) */
.product-card-horizontal {
    flex: 0 0 300px;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 140px;
    background:
        linear-gradient(145deg, rgba(4, 111, 173, 0.06), transparent 55%),
        var(--bg-secondary);
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
    transition: transform 0.35s ease;
}

.product-image.is-placeholder,
.deal-image.is-placeholder {
    object-fit: contain;
    padding: 18%;
    opacity: 0.85;
}

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

.discount-badge {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    z-index: 2;
    background: #e11d48;
    color: white;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.product-bookmark,
.bookmark-icon {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #51606c;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, 0.45);
    border: none;
    transition: all 0.2s;
}

.product-bookmark:hover,
.bookmark-icon:hover {
    transform: scale(1.06);
    color: var(--primary);
}

.product-bookmark.bookmarked,
.product-bookmark.active,
.bookmark-icon.active {
    color: var(--primary);
    background: rgba(4, 111, 173, 0.12);
}

.product-details {
    padding: 0.8rem 0.85rem 0.95rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
    letter-spacing: -0.015em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.seller-row,
.product-campus {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-tertiary, #7a8791);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-campus {
    color: var(--primary);
    font-weight: 600;
}

.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.product-price {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.product-old-price {
    font-size: 0.75rem;
    color: var(--text-tertiary, #8a969f);
    text-decoration: line-through;
}

.product-card-grid {
    position: relative;
    background: var(--bg-primary);
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid var(--border-light, #e6eef3);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.product-card-grid:hover {
    transform: none;
    border-color: rgba(4, 111, 173, 0.4);
    box-shadow: none;
}

.product-card-grid .product-image-wrapper {
    height: auto;
    aspect-ratio: 1 / 1;
}

.product-card-grid .product-details {
    padding: 0.75rem 0.8rem 0.9rem;
}

.product-card-grid .product-name {
    font-size: 0.86rem;
}

.product-card-grid .product-price {
    font-size: 0.98rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.9rem;
    }
}

@media (min-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
}

.category-tab {
    flex-shrink: 0;
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.product-price-old {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.seller-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0;
}

.seller-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.rating-star {
    color: #fbbf24;
    font-size: 0.875rem;
}

.rating-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-seller-btn {
    width: 100%;
    padding: 0.625rem;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    margin-top: auto;
}

.chat-seller-btn:hover {
    background: var(--primary);
    color: white;
}

.product-card-grid {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    border: 1.5px solid var(--border-light, #e6eef3);
    display: flex;
    flex-direction: column;
}

.product-card-grid .product-image-wrapper {
    height: 140px;
}

.product-card-grid .product-details {
    padding: 0.75rem;
}

.product-card-grid .product-name {
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-grid .product-price {
    font-size: 1rem;
}

.product-card-grid .chat-seller-btn {
    padding: 0.5rem;
    font-size: 0.8125rem;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

.skeleton-image {
    width: 100%;
    height: 100%;
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

/* Spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border: 3px solid rgba(var(--primary-rgb, 29, 155, 240), 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    z-index: 10;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

/* Product Detail Modal */
.product-detail-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: var(--bg-primary);
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    z-index: 1001;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.product-detail-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1002;
}

.product-detail-header .back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1.25rem;
}

.product-detail-header .back-btn:hover {
    background: var(--bg-hover);
}

.product-detail-header h1 {
    flex: 1;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.product-detail-header .placeholder {
    width: 40px;
}

#productDetailContent {
    padding: 72px 0 100px;
}

.product-detail-image-container {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
}

.product-detail-main-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-secondary);
}

.product-detail-thumbnail-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem;
    background: var(--bg-primary);
}

.product-detail-thumbnail-scroll::-webkit-scrollbar {
    display: none;
}

.product-detail-thumbnail {
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.product-detail-thumbnail:hover,
.product-detail-thumbnail.active {
    border-color: var(--primary);
}

.product-detail-info {
    padding: 1rem 1.5rem;
}

.product-detail-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.product-detail-price-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.product-detail-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.product-detail-price-old {
    font-size: 1.125rem;
    color: var(--text-tertiary);
    text-decoration: line-through;
}

.product-detail-discount {
    background: #1d9bf0;
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 700;
}

.product-detail-seller {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.product-detail-seller-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.product-detail-seller-info {
    flex: 1;
}

.product-detail-seller-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.product-detail-seller-campus {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.product-detail-seller-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fbbf24;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.product-detail-section {
    margin-bottom: 1.5rem;
}

.product-detail-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-detail-section-title i {
    color: var(--text-secondary);
}

.product-detail-specs {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.product-detail-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.product-detail-spec-row:last-child {
    border-bottom: none;
}

.product-detail-spec-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-detail-spec-label i {
    color: var(--text-tertiary);
}

.product-detail-spec-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.product-detail-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.product-detail-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    z-index: 1002;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.product-detail-action-btn {
    flex: 1;
    padding: 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.product-detail-action-btn.primary {
    background: var(--primary);
    color: white;
}

.product-detail-action-btn.primary:hover {
    opacity: 0.9;
}

.product-detail-action-btn.secondary {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.product-detail-action-btn.secondary:hover {
    background: var(--primary);
    color: white;
}

/* ── Active filter chips ─────────────────────────────────────── */
.sf-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.15rem;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
}
.sf-active-filters[hidden] { display: none !important; }
.sf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid rgba(4, 111, 173, 0.35);
  background: rgba(4, 111, 173, 0.08);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 650;
  cursor: pointer;
}
.sf-chip.is-static { cursor: default; }
.sf-chip i { font-size: 0.78rem; color: var(--primary); }

.filter-btn.has-filters {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Rugged campus / location pickers ────────────────────────── */
.sf-place-section { display: flex; flex-direction: column; gap: 0.55rem; }

.sf-picker-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1.5px solid var(--border-light, #d9e2e8);
  background: var(--bg-secondary, #f3f7fa);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sf-picker-trigger:hover:not(.is-disabled) {
  border-color: rgba(4, 111, 173, 0.45);
  background: #fff;
}
.sf-picker-trigger.is-open {
  border-color: var(--primary);
  background: #fff;
}
.sf-picker-trigger.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.sf-picker-ico {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1f2a;
  color: #fff;
  font-size: 1rem;
}
.sf-picker-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.sf-picker-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary, #7a8791);
}
.sf-picker-copy strong {
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-picker-chevron { color: #9aa8b2; transition: transform 0.15s ease; }
.sf-picker-trigger.is-open .sf-picker-chevron { transform: rotate(90deg); }

.sf-picker-panel {
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.sf-picker-search-wrap {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}
.sf-picker-search-wrap > i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8a969f;
}
.sf-picker-search {
  width: 100%;
  border: 0;
  outline: none;
  padding: 0.8rem 0.9rem 0.8rem 2.35rem;
  font: inherit;
  background: transparent;
  color: var(--text-primary);
}
.sf-picker-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overscroll-behavior: contain;
}
.sf-picker-group-label {
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary, #7a8791);
  padding: 0.45rem 0.55rem 0.15rem;
}
.sf-picker-tile {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  text-align: left;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sf-picker-tile:hover {
  background: var(--bg-secondary, #f3f7fa);
}
.sf-picker-tile.is-selected {
  border-color: rgba(4, 111, 173, 0.35);
  background: rgba(4, 111, 173, 0.08);
}
.sf-picker-tile.is-yours:not(.is-selected) {
  background: rgba(4, 111, 173, 0.04);
}
.sf-picker-tile-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1f2a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.sf-picker-tile-mark--all {
  background: #e8eef2;
  color: #3d4f5c;
}
.sf-picker-tile.is-selected .sf-picker-tile-mark {
  background: var(--primary);
}
.sf-picker-tile-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.sf-picker-tile-copy strong {
  font-size: 0.88rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-picker-tile-copy span {
  font-size: 0.72rem;
  color: var(--text-tertiary, #7a8791);
}
.sf-picker-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.65rem !important;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--primary) !important;
  background: rgba(4, 111, 173, 0.1);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}
.sf-picker-check {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: transparent;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sf-picker-tile.is-selected .sf-picker-check {
  color: #fff;
  background: var(--primary);
}
.sf-picker-empty {
  margin: 0;
  padding: 1rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ── Flat product tiles ──────────────────────────────────────── */
.product-card-grid {
  border-width: 1.5px;
  border-radius: 14px;
  box-shadow: none !important;
}
.product-card-grid:hover {
  transform: none;
  box-shadow: none !important;
}
.product-card-grid .product-name {
  font-weight: 800;
  letter-spacing: -0.025em;
}
.product-card-grid .product-campus {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-secondary, #5b6b75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card-grid .product-price {
  font-size: 1.05rem;
  font-weight: 850;
}
.product-price-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.product-rating {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(249, 115, 22, 0.1);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}
.product-rating i {
  color: #f97316;
  font-size: 0.72rem;
}

.product-card-horizontal {
  box-shadow: none;
  border: 1.5px solid var(--border-light, #e6eef3);
}

/* Filter Modal — full-height sheet; header/footer pinned, body scrolls */
#filterModal.modal-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    overscroll-behavior: contain;
}

.filter-modal-container {
    background: var(--bg-primary);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 520px;
    height: 100%;
    max-height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0;
    animation: filterSheetUp 0.28s ease;
    overflow: hidden;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
}

@keyframes filterSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.filter-modal-handle {
    display: flex;
    justify-content: center;
    padding: 0.55rem 0 0.15rem;
    flex-shrink: 0;
}

.filter-modal-handle span {
    width: 2.25rem;
    height: 0.28rem;
    border-radius: 99px;
    background: var(--border-light, #d5dee5);
}

.filter-modal-header {
    position: relative;
    padding: 0.65rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    gap: 0.75rem;
}

.filter-modal-header h3 {
    font-size: 1.2rem;
    font-weight: 750;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.filter-modal-header .close-modal-btn {
    position: static;
    top: auto;
    right: auto;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    background: var(--bg-secondary, #f3f7fa);
}

.filter-modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 1.15rem 1.25rem 1.5rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.01em;
}

/* Collapsible variant — spreads label and chevron */
.filter-section-toggle {
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.6rem;
    padding: .25rem 0;
}
.filter-section-toggle:hover { color: var(--primary); }
.filter-toggle-icon {
    font-size: .8rem;
    color: var(--text-muted, #aaa);
    transition: transform .2s;
    flex-shrink: 0;
}
/* "show more" button inside chips row */
.filter-show-more-btn {
    background: none;
    border: 1.5px dashed var(--border-light, #ddd);
    border-radius: 99px;
    padding: .35rem .875rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all .15s;
    margin-top: .1rem;
}
.filter-show-more-btn:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    border-color: var(--primary);
}

.filter-title i {
    color: var(--primary);
    font-size: 0.875rem;
    opacity: 0.85;
}

/* ── Price Range ───────────────────────────── */
.price-range-inputs {
    display: flex;
    align-items: stretch;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.price-range-inputs:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.price-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.875rem 0.4rem;
}

.price-input-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.price-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    padding: 0;
    width: 100%;
    -moz-appearance: textfield;
}

.price-input::-webkit-inner-spin-button,
.price-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.price-input:focus {
    outline: none;
}

.price-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.price-range-divider {
    width: 1px;
    background: var(--border-light);
    flex-shrink: 0;
    margin: 0.5rem 0;
}

/* ── Filter Chips (inline pill toggles) ───── */
.filter-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.filter-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.filter-chip span {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 99px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.18s;
    user-select: none;
}

.filter-chip input:checked + span {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-weight: 600;
}

.filter-chip:hover span {
    border-color: var(--primary);
    color: var(--text-primary);
}

/* ── Location select ───────────────────────── */
.filter-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    background-image: 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");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.25rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

/* ── Spec filter groups ────────────────────── */
.spec-filter-group {
    margin-bottom: 1rem;
}

.spec-filter-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-text-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

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

/* ── Custom scrollbars ─────────────────────── */
.filter-modal-body {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 35%, transparent) transparent;
    scrollbar-gutter: stable;
}

.filter-modal-body::-webkit-scrollbar {
    width: 4px;
}

.filter-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.filter-modal-body::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 35%, var(--border-light));
    border-radius: 99px;
}

.filter-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.filter-modal-footer {
    padding: 0.85rem 1.25rem calc(0.95rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    background: var(--bg-primary, #fff);
    box-shadow: 0 -10px 28px -18px rgba(15, 23, 42, 0.4);
}

.btn-reset {
    flex: 1;
    padding: 0.875rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: var(--bg-hover);
}

.btn-apply {
    flex: 2;
    padding: 0.875rem;
    border-radius: 8px;
    background: var(--primary);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apply:hover {
    opacity: 0.9;
}

/* ─────────────────────────────────────────────
   PRODUCT GRID
   ───────────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    margin-bottom: 2rem;
}

@media (min-width: 540px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─────────────────────────────────────────────
   TABLET
   ───────────────────────────────────────────── */
@media (min-width: 768px) {
    .shop-header {
        padding: 1.25rem 1.5rem;
    }
    .products-container {
        padding: 1.5rem;
    }
}

/* ─────────────────────────────────────────────
   DESKTOP LAYOUT  ≥ 1024 px
   Persistent filter sidebar (sticky in page flow)
   ───────────────────────────────────────────── */
@media (min-width: 1025px) {
    /* Keep collapsed sidebar working on shop page */
    body.sidebar-collapsed .main-content {
        margin-left: 72px !important;
    }

    /* ── Shop header: compact + hide-on-scroll ── */
    .shop-header {
        padding: 0.5rem 1.5rem;
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }
    .shop-header.hide {
        transform: translateY(-100%);
        box-shadow: none;
    }

    .header-top    { margin-bottom: 0.375rem; }
    .page-title    { font-size: 1.125rem; }
    .search-filter-container { margin-bottom: 0.375rem; }
    .category-tabs { padding-bottom: 0.25rem; }

    /* ── Two-column body layout (products stay full width) ── */
    .shop-body {
        display: block;
        min-height: calc(100dvh - var(--shop-header-h, 120px));
    }

    /* ── Show filter button on desktop ── */
    .filter-btn { display: flex !important; }

    /* ── Desktop: full-height popover side drawer (shop + shop search) ── */
    #filterModal.modal-overlay,
    #searchFilterModal.modal-overlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 1200 !important;
        display: none;
        align-items: stretch !important;
        justify-content: flex-start !important;
        background: rgba(15, 23, 42, 0.45) !important;
        padding: 0 !important;
        animation: fadeIn 0.2s ease !important;
        order: unset !important;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: none !important;
        top: auto !important;
        margin: 0 !important;
    }

    #filterModal.desktop-open,
    #filterModal.desktop-open[style],
    #searchFilterModal.desktop-open,
    #searchFilterModal.desktop-open[style] {
        display: flex !important;
    }

    #filterModal .filter-modal-handle,
    #searchFilterModal .filter-modal-handle { display: none !important; }

    #filterModal .filter-modal-container,
    #searchFilterModal .filter-modal-container {
        position: relative !important;
        transform: none !important;
        bottom: auto !important;
        left: auto !important;
        width: min(380px, 92vw) !important;
        max-width: min(380px, 92vw) !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        margin: 0 !important;
        border-radius: 0 16px 16px 0 !important;
        background: var(--bg-primary) !important;
        border: none !important;
        border-right: 1px solid var(--border-light) !important;
        box-shadow: 12px 0 40px rgba(15, 23, 42, 0.18) !important;
        animation: shopFilterDrawerIn 0.28s ease !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    @keyframes shopFilterDrawerIn {
        from { transform: translateX(-100%); }
        to { transform: translateX(0); }
    }

    #filterModal .filter-modal-header,
    #searchFilterModal .filter-modal-header {
        padding: 1rem 1.15rem !important;
        flex-shrink: 0 !important;
    }
    #filterModal .filter-modal-header h3,
    #searchFilterModal .filter-modal-header h3 {
        font-size: 1.1rem !important;
        font-weight: 800 !important;
    }

    /* Keep close button visible on desktop drawer */
    #filterModal .close-modal-btn,
    #searchFilterModal .close-modal-btn {
        display: flex !important;
        position: static !important;
        width: 2.25rem !important;
        height: 2.25rem !important;
    }

    #filterModal .filter-modal-footer,
    #searchFilterModal .filter-modal-footer {
        padding: 0.9rem 1.15rem calc(0.9rem + env(safe-area-inset-bottom, 0px)) !important;
        margin-top: auto;
        flex-shrink: 0 !important;
        box-shadow: 0 -10px 20px -16px rgba(15, 23, 42, 0.4);
    }

    #filterModal .filter-modal-body,
    #searchFilterModal .filter-modal-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 1.1rem 1.15rem !important;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--primary) 35%, transparent) transparent;
    }
    #filterModal .filter-modal-body::-webkit-scrollbar,
    #searchFilterModal .filter-modal-body::-webkit-scrollbar { width: 4px; }
    #filterModal .filter-modal-body::-webkit-scrollbar-track,
    #searchFilterModal .filter-modal-body::-webkit-scrollbar-track { background: transparent; }
    #filterModal .filter-modal-body::-webkit-scrollbar-thumb,
    #searchFilterModal .filter-modal-body::-webkit-scrollbar-thumb {
        background: color-mix(in srgb, var(--primary) 35%, var(--border-light));
        border-radius: 99px;
    }
    #filterModal .filter-modal-body::-webkit-scrollbar-thumb:hover,
    #searchFilterModal .filter-modal-body::-webkit-scrollbar-thumb:hover { background: var(--primary); }

    #filterModal .sf-picker-list {
        max-height: min(320px, 36vh);
    }

    /* ── Products area fills remaining space ── */
    .products-container {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 1.5rem !important;
        max-width: unset !important;
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* ── Product grids: 4 columns ── */
    .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem;
    }

    /* ── Bigger card images ── */
    .product-card-grid .product-image-wrapper { aspect-ratio: 1 / 1; height: auto; }

    /* ── Deals of the Day: horizontal scroll → 4-col grid ── */
    #dealsGrid.product-scroll {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 1rem !important;
        overflow-x: unset !important;
        padding: 0 !important;
    }
    #dealsGrid.product-scroll .product-card-horizontal {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        flex-direction: column !important;
    }
    #dealsGrid.product-scroll .product-card-horizontal .product-image-wrapper {
        width: 100% !important;
        height: 180px !important;
    }

    .section-title { font-size: 1.25rem; }
    .product-detail-sidebar { width: 100%; }
    .product-detail-info { max-width: 600px; margin: 0 auto; }
}

@media (min-width: 1280px) {
    .product-grid { grid-template-columns: repeat(4, 1fr) !important; }
    #dealsGrid.product-scroll { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (min-width: 1600px) {
    .product-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    min-height: 200px;
}

.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.empty-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Lock page scroll while the mobile filter sheet is open */
html.shop-filter-open,
html.shop-filter-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}
html.shop-filter-open #filterModal,
html.shop-filter-open #filterModal .filter-modal-body,
html.shop-filter-open #searchFilterModal,
html.shop-filter-open #searchFilterModal .filter-modal-body {
    touch-action: pan-y;
}

/* ── Shared chip filter UI (shop + search) ─────────────────── */
.ss-block { margin-bottom: 1.15rem; }
.ss-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary, #7a8791);
    margin: 0 0 0.55rem;
}
.ss-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ss-chip {
    padding: 0.38rem 0.85rem;
    border-radius: 99px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ss-chip:hover { border-color: var(--primary); color: var(--primary); }
.ss-chip.is-on {
    border-color: var(--primary);
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.ss-price-row { display: flex; gap: 0.45rem; align-items: center; }
.ss-price-in {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.88rem;
}
.ss-price-in:focus { outline: none; border-color: var(--primary); }
.ss-sort-select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
}
.filter-btn { position: relative; }
.filter-btn .ss-filter-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 99px;
    background: var(--primary);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
}
.filter-btn .ss-filter-badge.is-on { display: flex; }

/* Campus picker sits cleanly inside chip filter sheet */
#filterModal .sf-place-section { margin-bottom: 1.15rem; }
#filterModal .sf-place-section .ss-section-title { margin-bottom: 0.65rem; }
