/* Edwiser Store - Shop Page Styles */
/* Shop page, product cards, filters, and pagination */

.local-edwiserstore-shop-page {
  padding: 24px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: calc(100vh - 200px);
}

/* Filters bar - no background or border */
.shop-filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  padding: 8px 0px;
}

.shop-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
  max-width: 400px;
}

.shop-search-input {
  width: 100%;
  padding: 10px 38px 10px 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: #1f2937;
}

.shop-search-input::placeholder {
  color: #9ca3af;
}

.shop-search-input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: #2f80ed;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.1);
}

.shop-search-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.shop-search-btn:hover {
  color: #2f80ed;
}

.shop-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.shop-search-clear:hover {
  color: #ef4444;
  background: #fee2e2;
}

.shop-category-wrapper {
  min-width: 180px;
}

.shop-category-select,
.shop-sort-select {
  padding: 10px 32px 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  appearance: none;
  color: #1f2937;
  min-width: 150px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

.shop-category-select:focus,
.shop-sort-select:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: #2f80ed;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.1);
}

.shop-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.shop-view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0;
  background: white;
  overflow: hidden;
}

.shop-view-btn {
  background: white;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  border-radius: 0;
  margin: 0;
}

.shop-view-icon {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
  flex-shrink: 0;
}

.shop-view-btn:first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.shop-view-btn:last-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.shop-view-btn:not(:last-child) {
  border-right: 1px solid #d1d5db;
}

.shop-view-btn.active {
  background: #2f80ed;
  color: white;
  border-right-color: transparent;
}

.shop-view-btn.active + .shop-view-btn {
  border-left: none;
}

.shop-view-btn:hover:not(.active) {
  background: #f3f4f6;
}

.shop-view-btn:not(.active) .shop-view-icon {
  color: #6b7280;
}

.shop-view-btn:hover:not(.active) .shop-view-icon {
  color: #2f80ed;
}

.shop-view-btn.active .shop-view-icon {
  color: white;
}

.shop-view-btn.active:hover {
  background: #1e6fe0;
}

.shop-view-btn.active:hover .shop-view-icon {
  color: white;
}

.shop-product-count {
  margin-bottom: 24px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 400;
}

/* Empty States */
.shop-empty-state {
  text-align: center;
  padding: 60px 20px 80px;
  margin-top: 40px;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.shop-empty-state .empty-icon {
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.shop-empty-state .empty-illustration {
  width: 200px;
  height: 200px;
  max-width: 100%;
  display: block;
}

.shop-empty-state .empty-message {
  font-size: 24px;
  color: #374151;
  font-weight: 600;
  margin-top: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  letter-spacing: -0.015em;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .shop-empty-state {
    padding: 40px 20px 60px;
    margin-top: 30px;
  }

  .shop-empty-state .empty-illustration {
    width: 160px;
    height: 160px;
  }

  .shop-empty-state .empty-message {
    font-size: 20px;
  }
}

/* Products Container */
.shop-products-container {
  margin-bottom: 40px;
  padding-top: 23px;
  border-top: 1px solid #e0e0e0;
}

/* Card View - Grid Layout */
.shop-products-container.shop-view-card {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(344px, 1fr)
  ); /* Figma: card width 344px */
  gap: 24px;
  width: 100%;
}

/* Card wrapper - should not interfere with grid layout */
.shop-product-card-wrapper {
  width: 100%;
}

/* Responsive grid columns */
@media (min-width: 576px) {
  .shop-products-container.shop-view-card {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .shop-products-container.shop-view-card {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .shop-products-container.shop-view-card {
    grid-template-columns: repeat(4, 1fr);
  }
}

.shop-product-card {
  background: white;
  border-radius: 8px;
  border: 1px solid #ebf0f9;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  min-width: 0; /* Prevent flex items from expanding beyond container */
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: none;
}

.shop-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.shop-product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0; /* Prevent flex items from expanding beyond container */
  width: 100%;
}

.shop-product-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 344 / 200; /* Figma grid view image 344x200 */
  overflow: hidden;
  background: #f3f4f6;
  border-radius: 8px 8px 0 0;
}

.shop-product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-product-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px; /* tighter padding */
  height: 24px;
  border-radius: 3px; /* match Figma tag */
  font-size: 12px; /* slightly smaller text */
  font-weight: 600;
  background-color: #ffffff;
  color: #0051f9;
  z-index: 10;
  letter-spacing: 0.05em; /* subtle spacing */
  line-height: 1;
}

/* Category tag positioned below image, centered */
.shop-product-category-tag {
  background: #ebf0f9;
  color: #313848;
  margin: -12px auto 12px 12px; /* center horizontally */
  padding: 4px 12px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  font-weight: 600;
  z-index: 5;
  position: relative;
  display: block; /* allows auto margins */
  width: fit-content;
  max-width: calc(100% - 32px); /* Safety fallback */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  text-align: center;
  font-size: 12px;
}

.shop-product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.shop-product-title {
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 14px;
  margin-top: 0;
  color: #313848;
  line-height: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-product-title a {
  color: #313848;
  text-decoration: none;
}

.shop-product-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #6b7280;
  flex-wrap: wrap;
  justify-content: space-between;
}

.shop-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shop-meta-item i {
  font-size: 12px;
}

/* Star icon styling for ratings - yellow/gold color */
.shop-meta-item i.fa-star {
  color: #f59e0b; /* Amber/yellow color matching design */
  font-size: 13px;
}

/* Footer section with price and button */
.shop-product-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
}

.shop-product-price {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.shop-price-free,
.shop-price-enrolled,
.shop-price-actual {
  color: #2f80ed;
}

.shop-price-free,
.shop-price-enrolled {
  color: #313848 !important;
  text-transform: uppercase !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.shop-price-original {
  color: #9ca3af;
  text-decoration: line-through;
  font-size: 14px;
  font-weight: 400;
  margin-right: 0;
  line-height: 1.2;
}

.shop-product-btn {
  padding: 8px 16px;
  background: white;
  color: #2970f7;
  border: 1px solid #2970f7;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
  height: fit-content;
}

.shop-product-btn:hover {
  background: #2970f7;
  color: white;
  border-color: #2970f7;
}

/* List View */
.shop-products-container.shop-view-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* List wrapper - should not interfere with flex layout */
.shop-product-list-wrapper {
  width: 100%;
}

.shop-product-list-item {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.shop-product-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shop-product-list-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 20px;
}

/* List view image wrapper fixed size */
.shop-product-list-image-wrapper {
  position: relative;
  width: 390px;
  min-width: 390px;
  height: 208px; /* Figma list view image 390x208 */
  overflow: hidden;
  background: #f3f4f6;
}

.shop-product-list-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-product-list-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.shop-product-description {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-product-list-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #6b7280;
}

.shop-product-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.shop-product-list-footer .shop-product-btn {
  width: auto;
  min-width: 140px;
}

/* Pagination */
.shop-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.shop-pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.shop-pagination-link:hover {
  background: #f3f4f6;
  border-color: #2f80ed;
  color: #2f80ed;
}

.shop-pagination-link.active {
  background: #2f80ed;
  border-color: #2f80ed;
  color: white;
}

.shop-pagination-ellipsis {
  padding: 0 8px;
  color: #6b7280;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .shop-filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .shop-search-wrapper {
    max-width: 100%;
  }

  .shop-controls-right {
    justify-content: space-between;
    width: 100%;
  }

  .shop-products-container.shop-view-card {
    grid-template-columns: 1fr;
  }

  .shop-product-list-link {
    flex-direction: column;
  }

  .shop-product-list-image-wrapper {
    width: 100%;
    min-width: auto;
  }

  .shop-product-list-footer {
    flex-direction: column;
    gap: 16px;
  }

  .shop-product-list-footer .shop-product-btn {
    width: 100%;
  }
}

/* Design fixes */
#page-local-edwiserstore-shop #page {
  padding: 0 !important;
}

#page-local-edwiserstore-shop #topofscroll {
  padding: 0 !important;
  max-width: 100% !important;
}

#page-local-edwiserstore-shop #page-content div[role='main'] {
  padding: 0 !important;
}

#page-local-edwiserstore-shop #page-header {
  padding: 12px 24px !important;
  max-width: 1320px !important;
  margin: 0 auto !important;
}

#page-local-edwiserstore-shop .local-edwiserstore-shop-page {
  max-width: 1320px !important;
  margin: 0 auto !important;
}

#page-local-edwiserstore-shop .shop-product-link:hover,
#page-local-edwiserstore-shop .shop-product-link:focus,
#page-local-edwiserstore-shop .shop-product-list-link:hover,
#page-local-edwiserstore-shop .shop-product-list-link:focus {
  text-decoration: none !important;
}

#page-local-edwiserstore-shop .shop-product-list-link {
  gap: 0 !important;
}

#page-local-edwiserstore-shop .shop-product-link .shop-product-category-tag {
  margin-bottom: 0 !important;
}

#page-local-edwiserstore-shop
  .shop-product-list-link
  .shop-product-category-tag {
  margin-left: 0 !important;
  margin-top: 0 !important;
}

.local-edwiserstore-shop-page .shop-category-wrapper {
  max-width: 250px !important;
}

.local-edwiserstore-shop-page .shop-category-wrapper #shop-category-select {
  min-width: unset !important;
  width: 100% !important;
}

.local-edwiserstore-shop-page .shop-view-toggle {
  flex-shrink: 0 !important;
}

.local-edwiserstore-shop-page .shop-pagination-link:hover {
  text-decoration: none !important;
}

.local-edwiserstore-shop-page .shop-product-footer {
  align-items: center !important;
}

.local-edwiserstore-shop-page .shop-product-list-footer {
  justify-content: flex-end;
  gap: 24px;
}

.local-edwiserstore-shop-page .shop-product-price {
  flex: none;
}

.local-edwiserstore-shop-page .shop-product-list-image-wrapper {
  width: 100%;
  max-width: 390px;
  height: 100%;
  min-width: auto;
}

.local-edwiserstore-shop-page
  .shop-product-list-image-wrapper
  .shop-product-list-image {
  max-height: 245px;
}

@media (min-width: 768px) {
  .local-edwiserstore-shop-page .shop-products-container.shop-view-card {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (min-width: 1240px) {
  .local-edwiserstore-shop-page .shop-products-container.shop-view-card {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}
