/* ============================================
   PRODUCT MODULE STYLES - PRD Chapter 4
   ============================================ */

/* --- Shop Layout --- */
.yp-shop-main {
  padding: var(--yp-space-xl) 0 var(--yp-space-3xl);
}

.yp-shop-header {
  margin-bottom: var(--yp-space-xl);
}

.yp-shop-title {
  font-size: var(--yp-font-size-2xl);
  margin-top: var(--yp-space-md);
}

.yp-shop-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--yp-space-xl);
  align-items: start;
}

/* --- Breadcrumb --- */
.yp-breadcrumb {
  font-size: var(--yp-font-size-sm);
  color: var(--yp-text-muted);
  margin-bottom: var(--yp-space-md);
}

.yp-breadcrumb a {
  color: var(--yp-text-secondary);
}

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

.yp-breadcrumb-sep {
  margin: 0 8px;
  color: var(--yp-disabled);
}

/* --- Sidebar Filter --- */
.yp-shop-sidebar {
  background: var(--yp-bg-white);
  border-radius: var(--yp-radius-lg);
  box-shadow: var(--yp-shadow-sm);
  padding: var(--yp-space-lg);
  position: sticky;
  top: 90px;
}

.yp-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--yp-space-lg);
  padding-bottom: var(--yp-space-md);
  border-bottom: 1px solid var(--yp-border-light);
}

.yp-sidebar-header h3 {
  display: flex;
  align-items: center;
  gap: var(--yp-space-sm);
  font-size: var(--yp-font-size-md);
  margin: 0;
}

.yp-sidebar-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--yp-text-secondary);
  padding: 4px;
}

.yp-filter-group {
  margin-bottom: var(--yp-space-lg);
}

.yp-filter-title {
  font-size: var(--yp-font-size-base);
  font-weight: 600;
  margin-bottom: var(--yp-space-md);
  color: var(--yp-text-primary);
}

.yp-filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.yp-filter-list li {
  margin-bottom: var(--yp-space-xs);
}

.yp-filter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--yp-radius-md);
  color: var(--yp-text-secondary);
  font-size: var(--yp-font-size-sm);
  transition: all var(--yp-transition-fast);
}

.yp-filter-link:hover,
.yp-filter-link.active {
  background: rgba(74,86,153,0.06);
  color: var(--yp-primary);
}

.yp-filter-count {
  font-size: var(--yp-font-size-xs);
  color: var(--yp-text-muted);
}

/* Price Filter */
.yp-price-filter {
  display: flex;
  align-items: center;
  gap: var(--yp-space-sm);
}

.yp-price-filter .yp-input {
  width: 70px;
  padding: 8px 10px;
  font-size: var(--yp-font-size-sm);
}

.yp-price-sep {
  color: var(--yp-text-muted);
}

/* Rating Filter */
.yp-rating-filter .yp-filter-link {
  gap: 4px;
  justify-content: flex-start;
}

.yp-rating-filter .yp-star {
  font-size: 14px;
}

/* --- Shop Toolbar --- */
.yp-shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--yp-space-lg);
  padding: var(--yp-space-md);
  background: var(--yp-bg-white);
  border-radius: var(--yp-radius-md);
  box-shadow: var(--yp-shadow-sm);
}

.yp-filter-toggle {
  display: none;
}

.yp-shop-toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--yp-space-md);
}

.yp-view-toggle {
  display: flex;
  gap: 4px;
  background: var(--yp-bg-light);
  border-radius: var(--yp-radius-md);
  padding: 3px;
}

.yp-view-btn {
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: var(--yp-radius-sm);
  cursor: pointer;
  color: var(--yp-text-muted);
  transition: all var(--yp-transition-fast);
  display: flex;
  align-items: center;
}

.yp-view-btn.active {
  background: var(--yp-bg-white);
  color: var(--yp-primary);
  box-shadow: var(--yp-shadow-sm);
}

/* WooCommerce ordering override */
.yp-shop-toolbar .woocommerce-ordering select {
  border: 1px solid var(--yp-border);
  border-radius: var(--yp-radius-md);
  padding: 6px 30px 6px 12px;
  font-family: var(--yp-font-family);
  font-size: var(--yp-font-size-sm);
  color: var(--yp-text-primary);
  background-color: var(--yp-bg-white);
  cursor: pointer;
  appearance: auto;
}

.yp-result-count {
  font-size: var(--yp-font-size-sm);
  color: var(--yp-text-muted);
  white-space: nowrap;
}

.yp-result-count .woocommerce-result-count {
  margin: 0;
  padding: 0;
}

/* --- List View --- */
.yp-shop-content.list-view ul.products {
  display: flex;
  flex-direction: column;
  gap: var(--yp-space-md);
}

.yp-shop-content.list-view ul.products li.product {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--yp-space-lg);
  width: 100% !important;
  margin: 0 !important;
}

/* --- Pagination --- */
.yp-pagination {
  margin-top: var(--yp-space-xl);
}

.yp-pagination .woocommerce-pagination {
  text-align: center;
}

.yp-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.yp-pagination .page-numbers li {
  list-style: none;
}

.yp-pagination .page-numbers a,
.yp-pagination .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--yp-radius-md);
  font-size: var(--yp-font-size-sm);
  font-weight: 500;
  color: var(--yp-text-secondary);
  transition: all var(--yp-transition-fast);
  text-decoration: none;
}

.yp-pagination .page-numbers a:hover {
  background: rgba(74,86,153,0.08);
  color: var(--yp-primary);
}

.yp-pagination .page-numbers span.current {
  background: var(--yp-primary);
  color: var(--yp-text-white);
}

.yp-pagination .page-numbers .prev,
.yp-pagination .page-numbers .next {
  font-weight: 600;
}

/* --- Empty State --- */
.yp-empty-state {
  text-align: center;
  padding: var(--yp-space-3xl) var(--yp-space-lg);
}

.yp-empty-state svg {
  margin-bottom: var(--yp-space-lg);
}

.yp-empty-state h3 {
  margin-bottom: var(--yp-space-sm);
}

.yp-empty-state p {
  margin-bottom: var(--yp-space-lg);
}

/* --- Single Product --- */
.yp-product-main {
  padding: var(--yp-space-lg) 0 var(--yp-space-3xl);
}

/* Share buttons */
.yp-product-share {
  display: flex;
  align-items: center;
  gap: var(--yp-space-md);
  margin-top: var(--yp-space-lg);
  padding-top: var(--yp-space-lg);
  border-top: 1px solid var(--yp-border-light);
}

.yp-product-share__label {
  font-size: var(--yp-font-size-sm);
  font-weight: 500;
  color: var(--yp-text-secondary);
}

.yp-product-share__icons {
  display: flex;
  gap: var(--yp-space-sm);
}

.yp-share-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--yp-radius-full);
  color: var(--yp-text-secondary);
  background: var(--yp-bg-light);
  transition: all var(--yp-transition-fast);
}

.yp-share-facebook:hover { background: #1877F2; color: #fff; }
.yp-share-twitter:hover  { background: #1DA1F2; color: #fff; }
.yp-share-whatsapp:hover { background: #25D366; color: #fff; }

/* Subscribe Option */
.yp-subscribe-option {
  margin: var(--yp-space-md) 0;
  padding: var(--yp-space-md);
  border: 2px solid var(--yp-border-light);
  border-radius: var(--yp-radius-lg);
  transition: border-color var(--yp-transition-fast);
}

.yp-subscribe-option:has(.yp-subscribe-checkbox:checked) {
  border-color: var(--yp-primary);
  background: rgba(74,86,153,0.03);
}

.yp-subscribe-toggle {
  display: flex;
  align-items: center;
  gap: var(--yp-space-md);
  cursor: pointer;
}

.yp-subscribe-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--yp-primary);
  cursor: pointer;
}

.yp-subscribe-toggle__title {
  font-weight: 600;
  color: var(--yp-primary);
  display: block;
}

.yp-subscribe-toggle__price {
  font-size: var(--yp-font-size-sm);
  color: var(--yp-text-secondary);
}

.yp-subscribe-schedule {
  margin-top: var(--yp-space-md);
  padding-top: var(--yp-space-md);
  border-top: 1px solid var(--yp-border-light);
}

.yp-subscribe-schedule label {
  display: block;
  font-size: var(--yp-font-size-sm);
  font-weight: 500;
  margin-bottom: var(--yp-space-xs);
}

.yp-subscribe-schedule select {
  width: 100%;
}

/* Related Products */
.yp-related-products {
  border-top: 1px solid var(--yp-border-light);
  margin-top: var(--yp-space-xl);
}

.yp-section-heading {
  font-size: var(--yp-font-size-xl);
  margin-bottom: var(--yp-space-lg);
}

/* --- Search Suggestions --- */
.yp-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--yp-bg-white);
  border-radius: 0 0 var(--yp-radius-lg) var(--yp-radius-lg);
  box-shadow: var(--yp-shadow-lg);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
}

.yp-search-dropdown.open {
  display: block;
}

.yp-search-item {
  display: flex;
  align-items: center;
  gap: var(--yp-space-md);
  padding: 10px var(--yp-space-md);
  border-bottom: 1px solid var(--yp-border-light);
  transition: background var(--yp-transition-fast);
  text-decoration: none;
  color: var(--yp-text-primary);
}

.yp-search-item:last-child {
  border-bottom: none;
}

.yp-search-item:hover {
  background: var(--yp-bg-light);
}

.yp-search-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--yp-radius-sm);
}

.yp-search-item__info {
  flex: 1;
}

.yp-search-item__name {
  font-size: var(--yp-font-size-sm);
  font-weight: 500;
  display: block;
}

.yp-search-item__price {
  font-size: var(--yp-font-size-xs);
  color: var(--yp-primary);
  font-weight: 600;
}

.yp-search-noresult {
  padding: var(--yp-space-lg);
  text-align: center;
  color: var(--yp-text-muted);
  font-size: var(--yp-font-size-sm);
}

/* --- Responsive --- */
@media (max-width: 1023px) {
  .yp-shop-layout {
    grid-template-columns: 1fr;
  }

  .yp-shop-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    z-index: 9999;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--yp-transition-base);
  }

  .yp-shop-sidebar.open {
    display: block;
    transform: translateX(0);
  }

  .yp-sidebar-close {
    display: block;
  }

  .yp-filter-toggle {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .yp-shop-toolbar {
    flex-wrap: wrap;
    gap: var(--yp-space-sm);
  }

  .yp-shop-toolbar__right {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
  }

  .yp-product-share__icons {
    flex-wrap: wrap;
  }
}
