/* ==========================================================================
   Phone Exchange – Shop Page Layout
   Matches React Products.tsx layout: breadcrumbs, title row, 2-col layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   Breadcrumbs (already has base styles in overrides.css, supplement here)
   -------------------------------------------------------------------------- */
.pe-shop .pe-breadcrumbs {
  padding: 0.75rem 0;
  margin-bottom: 0;
  font-size: 0.8125rem;
}

.pe-breadcrumbs .pe-breadcrumb-sep {
  margin: 0 0.375rem;
  opacity: 0.5;
}


/* --------------------------------------------------------------------------
   Shop Header Row (Title + Sort)
   React: flex items-center justify-between mb-5
   -------------------------------------------------------------------------- */
.pe-shop__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem; /* mb-5 = 20px */
}

.pe-shop__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--pe-foreground);
  margin: 0;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .pe-shop__title {
    font-size: 1.875rem; /* md:text-3xl */
  }
}

.pe-shop__count {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem; /* mt-0.5 */
  margin-bottom: 0;
}

/* Sort dropdown – desktop only */
.pe-shop__sort {
  display: none;
}

@media (min-width: 768px) {
  .pe-shop__sort {
    display: block;
  }
}

.pe-shop__sort select {
  font-size: 0.75rem; /* text-xs */
  font-family: var(--font-body);
  font-weight: 500;
  background-color: var(--pe-card);
  border: 1px solid var(--pe-border);
  border-radius: 0.5rem; /* rounded-lg */
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  color: var(--pe-foreground);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
}

.pe-shop__sort select:focus {
  outline: none;
  border-color: var(--pe-accent);
  box-shadow: 0 0 0 3px hsla(190, 100%, 45%, 0.15);
}

/* Mobile filter trigger button */
.pe-shop__mobile-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: var(--pe-card);
  border: 1px solid var(--pe-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--pe-foreground);
  cursor: pointer;
  transition: border-color var(--pe-transition-fast);
}

.pe-shop__mobile-filter-btn:hover {
  border-color: var(--pe-accent);
}

.pe-shop__mobile-filter-btn .pe-filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background: var(--pe-accent);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
}

@media (min-width: 768px) {
  .pe-shop__mobile-filter-btn {
    display: none;
  }
}


/* --------------------------------------------------------------------------
   Two-Column Layout (Sidebar + Grid)
   React: flex gap-6 → aside w-56 shrink-0 + flex-1
   -------------------------------------------------------------------------- */
.pe-shop__layout {
  display: flex;
  gap: 1.5rem; /* gap-6 */
}

.pe-shop__sidebar {
  display: none; /* Hidden on mobile */
  width: 14rem; /* w-56 = 224px */
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .pe-shop__sidebar {
    display: block;
  }
}

.pe-shop__content {
  flex: 1;
  min-width: 0;
}


/* --------------------------------------------------------------------------
   Product Grid
   React: grid grid-cols-2 lg:grid-cols-3 gap-3 md:gap-5
   -------------------------------------------------------------------------- */
.pe-shop__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem; /* gap-3 */
}

@media (min-width: 768px) {
  .pe-shop__grid {
    gap: 1.25rem; /* md:gap-5 */
  }
}

@media (min-width: 1024px) {
  .pe-shop__grid {
    grid-template-columns: repeat(3, 1fr); /* lg:grid-cols-3 */
  }
}

/* Remove default WC product list styling that conflicts */
.pe-shop__grid .pe-phone-card {
  margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.pe-shop__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: hsl(var(--muted-foreground));
}

.pe-shop__empty-icon {
  margin: 0 auto 1rem;
  opacity: 0.3;
}

.pe-shop__empty p {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.pe-shop__empty-clear {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--pe-accent);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity var(--pe-transition-fast);
}

.pe-shop__empty-clear:hover {
  opacity: 0.8;
}


/* --------------------------------------------------------------------------
   WC Pagination Override (for shop page context)
   -------------------------------------------------------------------------- */
.pe-shop .woocommerce-pagination {
  margin-top: 2rem;
}

.pe-shop .woocommerce-pagination ul {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  border: none;
}

.pe-shop .woocommerce-pagination ul li {
  border: none;
  margin: 0;
  padding: 0;
  float: none;
}

.pe-shop .woocommerce-pagination ul li a,
.pe-shop .woocommerce-pagination ul li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: var(--pe-radius-sm);
  border: 1px solid var(--pe-border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pe-foreground);
  text-decoration: none;
  transition: all var(--pe-transition-fast);
  background: var(--pe-card);
}

.pe-shop .woocommerce-pagination ul li a:hover {
  background: var(--pe-secondary);
  border-color: var(--pe-muted-foreground);
}

.pe-shop .woocommerce-pagination ul li span.current {
  background: var(--pe-primary);
  color: var(--pe-primary-foreground);
  border-color: var(--pe-primary);
}

/* Results count text (e.g. "Showing 1-12 of 12 results") */
.pe-shop .woocommerce-result-count {
  display: none; /* We show count in the header row instead */
}

/* Hide default WC ordering if it leaks through */
.pe-shop .woocommerce-ordering {
  display: none;
}


/* --------------------------------------------------------------------------
   Storefront overrides specific to shop page
   -------------------------------------------------------------------------- */

/* Remove Storefront's content-area/sidebar layout */
.pe-shop-page .site-main {
  width: 100%;
  float: none;
}

.pe-shop-page #secondary {
  display: none; /* We use our custom sidebar instead */
}

/* Remove Storefront's default page header styling */
.pe-shop-page .page-header {
  display: none; /* We render our own title row */
}

/* Ensure col-full doesn't add extra constraints */
.pe-shop-page .site-content > .col-full {
  padding-top: 0;
}

/* Remove default WC wrapper margins */
.pe-shop-page .woocommerce-products-header {
  display: none;
}
