/*
 * PRODUCT.CSS
 * ===========
 * Product-related styles: product cards, product pages, categories, reviews, and product management
 * Contains styles for product display, product details, categories, ratings, and product interactions
 */

/* ==========================================================================
   Product Tags
   ========================================================================== */

.tag {
  padding: 5px;
  border-radius: 7px;
  font-size: 12px;
}

.artesnal-tag {
  background: #9DA4E8;
}

.topdeal-tag {
  background-color: #C3EE49;
}

.bestseller-tag {
  background-color: white;
  border: 1px solid #c7c7c7;
}

.discount-tag {
  background-color: #DB4444;
  color: white;
}

/* ==========================================================================
   Product Cards
   ========================================================================== */

.product-card {
  padding: 10px;
  transition: 0.3s;
  border-radius: 5px;
}

.product-group-minimal {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-minimal {
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: all 0.3s ease;
  flex: 1;
  border-radius: 8px;
  background: white;
  border: 1px solid #e8e8e8;
  cursor: pointer;
}

.product-card-minimal:hover {
  border-color: #d1d1d1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.product-card-container {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.similar-products-container .product-card-container {
  padding: 0;
}

.product-card-container a{
  text-decoration: none;
  color: black;
}

.product-card-container a:hover{
  text-decoration: none;
  color: #DB4444;
}

.product-card-header {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
}

.product-card-header:hover {
  cursor: default;
}

.product-card-store {
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
}

.product-card-name {
  padding: 8px 0 8px 0;
}

.similar-products-container .product-card-name {
  padding: 0;
  margin-bottom: 8px;
}

.product-card-image {
  width: 100%;
  /* Uniform square box so every card image is the same size regardless of
     the dimensions the seller uploaded. Loads after style.css's height:auto,
     so this is the winning rule for all .product-card grids. */
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fafafa;
  border-radius: 6px;
  margin-bottom: 12px;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card-minimal:hover .product-card-image img {
  transform: scale(1.05);
}

/* Similar Products - Specific styling */
.similar-products-container .product-card-image {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  aspect-ratio: 1;
}

.similar-products-container .product-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.similar-products-container .product-card-minimal {
  border: 1px solid #e8e8e8;
}

.similar-products-container .product-card-name h4 {
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #111111;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 42px;
}

.similar-products-container .product-card-price h3 {
  font-size: 20px;
  font-weight: 700;
  color: #DB4444;
  margin: 4px 0 8px 0;
}

.similar-products-container .rating.cart-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #565959;
}

.similar-products-container .rating.cart-item .star {
  color: #FFA41C;
  font-size: 15px;
}

.similar-products-container .review-count-text {
  color: #007185;
  font-size: 13px;
  margin: 0;
}

.product-card-price {
  color: red!important;
  font-weight: bold;
}

.similar-products-container .product-card-price {
  margin-bottom: 8px;
}

.product-card-delivery {
  padding: 8px 0 8px 0;
  font-size: 13px;
}

.product-card-source {
  display: flex;
  font-size: 12px;
}

.product-card-source label{
  font-weight: 100;
  margin-bottom: 0;
  margin-right: 10px;
}

.product-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Trending / Para Ti minimal product cards (homePageLoader.js createMinimalProductCard)
   — plain links, no default browser underline/blue */
.product-card-minimal-grid a {
  text-decoration: none;
  color: inherit;
}

/* More From This Shop - Grid Layout */
.product-more-products .product-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-more-products {
  background: white;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  margin-top: 24px;
}

.product-more-products h2 {
  font-size: 20px;
  font-weight: 600;
  color: #111111;
  margin: 0 0 20px 0;
  letter-spacing: -0.02em;
}

.product-more-products .product-group-minimal {
  width: 100%;
}

.product-more-products .product-card-minimal {
  height: 100%;
}

.product-more-products .product-card-image {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  background: #fafafa;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
}

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

.product-more-products .product-card-name h4 {
  font-size: 15px;
  line-height: 1.4;
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #111111;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 42px;
}

.product-more-products .product-card-price h3 {
  font-size: 20px;
  font-weight: 700;
  color: #DB4444;
  margin: 4px 0 8px 0;
}

.product-more-products .rating.cart-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #565959;
}

.product-more-products .rating.cart-item .star {
  color: #FFA41C;
  font-size: 15px;
}

.product-more-products .review-count-text {
  color: #007185;
  font-size: 13px;
  margin: 0;
}

.product-more-products .product-card-container {
  padding: 0;
}

.product-more-products .product-card-minimal:hover .product-card-image img {
  transform: scale(1.05);
}

.product-group {
  display: flex;
  flex-direction: row;
  margin-right: 20px;
  margin-bottom: 20px;
  background-color: white;
}

/* ==========================================================================
   Product Pages & Details
   ========================================================================== */

.product-page-container {
  display: flex;
  gap: 20px;
  background: white;
  box-shadow: 0 1px 1px 0 rgba(0,0,0,.05);
}

.product-image-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-images {
  display: flex;
}

.product-page-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-width: 0;
}

.product-page-options {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-width: 0;
}

.product-page-header {
  display: flex;
  justify-content: space-between;
}

.product-page-like {
  background: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
}

.product-page-like.active {
  color: red;
}

.product-page-quantity {
  display: flex;
  padding: 20px 0 20px 0;
}

.product-page-security {
  padding: 20px;
  border: 1px solid #c7c7c7;
  border-radius: 5px;
  background-color: #fafafa;
}

.product-page-button {
  display: flex;
}

/* ==========================================================================
   Product Gallery & Images
   ========================================================================== */

.product-gallery {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  min-width: 0;
  max-width: 640px; /* Prevent overflow, allow 600px image + padding */
}

.product-gallery-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.thumbnail-row {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
}

.thumbnail-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-direction: column;
  padding: 20px;
}

.thumbnail-wrapper {
  width: 80px;
  height: 80px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #8f8f8f;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main-image-container {
  width: 100%;
  max-width: 600px;
  height: auto;
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  cursor: none;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.magnifier {
  position: absolute;
  width: 200px;
  height: 200px;
  background-repeat: no-repeat;
  background-size: 800px 800px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.main-image-container:hover .magnifier {
  opacity: 1;
}

/* Removed problematic loading states */

/* Thumbnail Active States */
.thumbnail-wrapper.active {
  border: 2px solid #007185;
  border-radius: 4px;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 113, 133, 0.3);
}

.thumbnail-wrapper {
  transition: all 0.3s ease;
  cursor: pointer;
}

.thumbnail-wrapper:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Main Image Transitions */
.main-image {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: zoom-in;
}

.main-image:hover {
  transform: scale(1.02);
}

/* Variation Thumbnails */
.variation-thumbnail {
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
}

.variation-thumbnail:hover {
  border-color: #007185;
  transform: scale(1.05);
}

.variation-thumbnail.active {
  border-color: #007185;
  box-shadow: 0 0 0 1px #007185;
}


.thumbnail-grid {
  bottom: 10px;
  left: 10px;
  display: flex;
}

.main-image-link {
  display: block;
}

/* ==========================================================================
   Product Information & Content
   ========================================================================== */

.product-description {
  font-size: 14px;
  margin-top: 10px;
}

.product-container-tags {
  margin-top: 10px;
}

.product-container-review-stock {
  margin-top: 10px;
}

.product-discount-price {
  font-size: 22px;
  font-weight: 700;
  color: #16a34a;
}

.product-stock-status {
  margin-left: 15px;
  font-size: 14px;
  color: #B65700;
}

.product-container-shop-link-container {
  font-size: 14px;
  margin-top: 10px;
}

.product-container-shop-link {
  text-decoration: none;
  color: #7B44F1;
}

.product-container-price {
  color: #DB4444;
  margin-top: 10px;
  background-color: #fafafa;
  padding: 10px;
  font-weight: bold;
  font-size: 1.875rem;
}

.in-stock {
  font-weight: bold;
  color: #249f38;
}

.product-info-display {
  margin-bottom: 15px;
}

/* ==========================================================================
   Product Variations & Options
   ========================================================================== */

.product-variatons-container {
  margin-top: 10px;
  border-top: 1px solid #c7c7c7;
}

.variations-label {
  font-size: 14px;
}

.variation-label {
  margin-top: 20px;
  font-weight: bold;
}

.variation-container {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.variation-thumbnail {
  width: 80px;
  height: 80px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}

.variation-thumbnail.active {
  border-color: #ccc;
}

.variation-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Product Collapsible Sections
   ========================================================================== */

.product-page-collapsible {
  border-bottom: 1px solid #ccc;
}

.product-page-collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}

.product-page-collapsible-header h4 {
  margin: 0;
}

.collapsible-icon {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.product-page-collapsible-content {
  display: none;
  padding: 10px;
  font-size: 14px;
}

.product-page-collapsible.active .collapsible-icon {
  transform: rotate(45deg);
}

.product-page-collapsible.active .product-page-collapsible-content {
  display: block;
}

/* ==========================================================================
   Similar Products
   ========================================================================== */

/* Similar Products Section */
.similar-products {
  background: white;
  padding: 24px;
  margin: 24px 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.similar-products-container {
  display: flex;
  gap: 24px;
  width: 100%;
}

.similar-products-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8e8e8;
}

.similar-products-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111111;
  margin: 0;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   Product Utility Items
   ========================================================================== */

.item {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.item i {
  font-size: 20px;
  margin-right: 10px;
  color: #333;
}

.item p {
  margin: 0;
  font-size: 14px;
  color: #4d4d4d
}

.item p:first-child {
  font-weight: bold;
  font-family: 'Inter';
}

/* ==========================================================================
   Product Small Details
   ========================================================================== */

.product-small-details {
  display: flex;
  font-size: 12px;
  margin-top: 10px;
}

.product-small-details:first-child {
  margin-top: 20px;
}

.small-details-name {
  padding-right: 10px;
  color: #565959;
}

.small-details-description {
  color: #007185;
}

/* ==========================================================================
   Customer Reviews & Ratings
   ========================================================================== */

.customer-reviews {
  display: flex;
  color: #0F1111;
}

.review-summary {
  flex: 1; 
  padding: 20px;
  min-width: 300px;
}

.average-rating {
  font-size: 17px;
  margin-bottom: 20px;
  margin-top: 10px;
}

.star-breakdown {
  margin-bottom: 20px;
}

.star-breakdown > div {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  cursor: pointer;
}

.star-breakdown > div:hover {
  text-decoration: underline;
  color: red;
}

.bar {
  display: inline-block;
  height: 12px;
  background-color: #FFA41C;
  border-radius: 6px;
  margin: 0 8px;
  flex: 1;
  max-width: 120px;
}

.label {
  width: 80px;
  flex-shrink: 0;
}

.review-list {
  flex: 2;
  padding: 20px;
}

.review {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ccc;
}

.review-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.review-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  margin-right: 10px;
}

.reviewer-name {
  font-weight: bold;
}

.review-rating {
  margin-bottom: 5px;
}

.stars {
  color: #FFA41C;
  margin-right: 5px;
}

.review-meta {
  color: #565959;
  font-size: 14px;
  margin-bottom: 10px;
}

.verified {
  color: #007185;
  margin-left: 10px;
}

.review-text {
  line-height: 1.5;
  margin-bottom: 10px;
  font-size: 14px;
}

.review-title {
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: bold;
}

.review-images {
  margin-top: 10px;
  cursor: pointer;
}

.review-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  margin-right: 5px;
  border-radius: 3px;
}

.review-actions {
  margin-top: 10px;
}

.report-link {
  color: #007185;
  text-decoration: none;
  font-size: 14px;
}

.report-link:hover {
  text-decoration: underline;
}

/* Seller Response Styles */
.seller-response {
  background-color: #f7f7f7;
  border-left: 4px solid #ff9900;
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 10px;
  border-radius: 4px;
}

.seller-response-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #0F1111;
  font-size: 14px;
}

.seller-response-header i {
  color: #ff9900;
  font-size: 16px;
}

.seller-response-header strong {
  font-weight: 700;
}

.seller-response-date {
  color: #565959;
  font-size: 13px;
  margin-left: auto;
}

.seller-response-text {
  color: #0F1111;
  line-height: 1.5;
  font-size: 14px;
  margin-left: 24px;
}

/* ==========================================================================
   Read More Functionality
   ========================================================================== */

.read-more-state {
  display: none;
}

.read-more-target {
  opacity: 0;
  max-height: 0;
  font-size: 0;
  transition: .25s ease;
}

.read-more-state:checked ~ .read-more-wrap .read-more-target {
  opacity: 1;
  font-size: inherit;
  max-height: 999em;
  font-size: 14px;
}

.read-more-trigger {
  cursor: pointer;
  display: inline-block;
  color: #007185;
  font-size: 14px;
}

.read-more-state ~ .read-more-trigger:before {
  content: 'Read more';
}

.read-more-state:checked ~ .read-more-trigger:before {
  content: 'Read less';
}

/* Review Modal - Star Rating */
.star-rating {
  display: inline-flex;
  gap: 8px;
  font-size: 32px;
}

.star-review {
  cursor: pointer;
  color: #ddd;
  transition: color 0.2s ease;
}

.star-review:hover,
.star-review.active {
  color: #FFA41C;
}

.no-reviews {
  padding: 40px 20px;
  text-align: center;
  color: #565959;
  font-size: 16px;
}

.reviews-container {
  display: flex;
  flex-direction: column;
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 30px;
  margin-bottom: 20px;
  padding: 20px 0;
  border-top: 1px solid #e7e7e7;
}

.pagination a {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid #d5d9d9;
  background-color: #ffffff;
  color: #0F1111;
  text-decoration: none;
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pagination a:hover:not(.active):not(.disabled) {
  background-color: #f7f8f8;
  border-color: #888c8c;
}

.pagination a.active {
  background-color: #ff9900;
  border-color: #ff9900;
  color: white;
  font-weight: 600;
  cursor: default;
}

.pagination a.disabled {
  color: #888c8c;
  cursor: not-allowed;
  opacity: 0.5;
}

.pagination a.disabled:hover {
  background-color: #ffffff;
  border-color: #d5d9d9;
}

.pagination-ellipsis {
  padding: 0 8px;
  color: #565959;
  font-size: 14px;
}

/* Mobile responsive pagination */
@media (max-width: 768px) {
  .pagination {
    gap: 2px;
    padding: 15px 0;
  }

  .pagination a {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    font-size: 13px;
  }

  .pagination-ellipsis {
    padding: 0 4px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .pagination {
    gap: 1px;
  }

  .pagination a {
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    font-size: 12px;
  }

  .pagination-ellipsis {
    padding: 0 2px;
  }
}

/* ==========================================================================
   Categories & Browse Sections
   ========================================================================== */

.categories-section {
  padding: 0;
}

.categories-header {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 20px;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #333;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

.category-item:hover {
  border-color: #999;
  background-color: #e4e4e4;
}

.category-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 10px;
}

.category-item span {
  font-size: 14px;
  text-align: center;
}

.shop-all-items,
.shop-categories,
.shop-deals {
  padding: 25px;
  margin-bottom: 20px;
}

.home-page-category-display {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
}

.category-container {
  width: 30%;
  padding: 30px;
  background: #fafafa;
}

.category-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.category-content {
  position: relative;
}

/* Subcategory styles removed - empty rule */

/* ==========================================================================
   Flash Sales
   ========================================================================== */

.flash-sales-section {
  margin-top: 40px;
}

.flash-sales-header {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 20px;
}

.flash-sales-title {
  font-size: 24px;
  font-weight: bold;
}

.flash-sales-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #cf1f1f;
}

.timer-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 5px;
}

.timer-labels span {
  font-size: 12px;
}

.timer-digits {
  display: flex;
  justify-content: center;
  align-items: center;
}

.timer-digits span {
  font-size: 36px;
  font-weight: bold;
  margin: 0 5px;
}

.flash-sales-navigation {
  display: flex;
}

.prev-arrow,
.next-arrow {
  font-size: 24px;
  cursor: pointer;
  margin-left: 10px;
}

.flash-sales-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  background-color: #fafafa;
  padding: 30px;
}

/* ==========================================================================
   Product Utilities
   ========================================================================== */

.main-content-sub-header{
  font-size: 13px;
  margin-bottom: 5px;
}

.small-padding-left {
  padding-left: 10px;
}

.label-error {
  background-color: red;
  color: white!important;
  padding: 10px;
}

/* Dynamic Product Variations */
.variation-item {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.variation-item:hover {
    border-color: #6366f1;
    background: #f8fafc;
}

.variation-item.active {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.variation-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.variation-price {
    font-size: 18px;
    font-weight: 700;
    color: #6366f1;
}

.variation-stock {
    font-size: 12px;
    margin-top: 4px;
}

.variation-stock.in-stock {
    color: #10b981;
}

.variation-stock.out-stock {
    color: #ef4444;
}

.variation-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

/* ==========================================================================
   PRODUCT DETAIL PAGE — MOBILE RESPONSIVENESS
   --------------------------------------------------------------------------
   All rules below are wrapped in max-width queries (<= 991.98px) so the
   desktop layout (>= 1200px, and the original >= 992px design) stays
   pixel-identical. Nothing here affects screens >= 992px.
   product.css is the last product stylesheet loaded, so these win the
   cascade over any earlier mobile rules in responsive.css.
   ========================================================================== */

/* --- Stack the 3-column product layout into a single column on tablets/phones
   (fixes the 576px–767px gap where the container stayed a cramped flex row) --- */
@media (max-width: 991.98px) {
  .product-page-container {
    flex-direction: column;
    gap: 0;
  }

  .product-gallery,
  .product-page-details,
  .product-page-options {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
    box-sizing: border-box;
  }

  /* Gallery main image must never exceed the viewport */
  .product-gallery {
    padding: 16px;
  }

  .main-image-container {
    width: 100%;
    max-width: 100%;
  }

  /* Shop info row: avatar + name + action button should wrap, not overflow */
  .shop-info-header {
    flex-wrap: wrap;
  }

  .shop-details {
    flex-direction: column;
    gap: 8px;
  }
}

/* --- Phone layout (<= 768px): tappable controls, readable type, no overflow --- */
@media (max-width: 768px) {
  /* Thumbnails: lay them out horizontally and wrap instead of a tall
     vertical column with heavy padding */
  .thumbnail-container {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px 0;
    margin-bottom: 12px;
    gap: 8px;
  }

  .thumbnail-wrapper {
    width: 64px;
    height: 64px;
  }

  /* No magnifier / zoom cursor on touch devices */
  .main-image-container {
    cursor: default;
  }

  .magnifier {
    display: none !important;
  }

  .main-image {
    cursor: default;
  }

  .main-image:hover {
    transform: none;
  }

  /* Title + price sizing */
  .product-page-header h2,
  #product-name {
    font-size: 20px;
    line-height: 1.3;
  }

  .product-container-price {
    font-size: 1.5rem;
  }

  /* Buy controls: full-width, min 44px tap targets */
  .product-page-buttons .quantity-stepper {
    display: flex;
    width: 100%;
    height: 44px;
    margin-top: 12px;
  }

  .product-page-buttons .quantity-stepper .qty-btn {
    width: 52px;
  }

  .product-page-buttons .quantity-stepper .qty-input {
    flex: 1;
    width: auto;
  }

  .cart-button,
  .buy-now-button {
    min-height: 44px;
    padding: 13px;
    font-size: 15px;
  }

  /* Shop header action button full width and tappable */
  .shop-header-actions {
    width: 100%;
    margin-top: 12px;
  }

  .shop-header-actions button,
  .view-shop-btn {
    width: 100%;
    margin-left: 0;
    min-height: 44px;
  }

  /* Review filter buttons wrap instead of overflowing horizontally */
  .review-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Similar products + more-from-shop: single column, no horizontal scroll */
  .similar-products-container {
    flex-direction: column;
    gap: 16px;
  }

  .product-more-products .product-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Trim oversized section padding on small screens */
  .similar-products,
  .product-more-products {
    padding: 16px;
  }

  .product-page-security {
    padding: 16px;
  }

  /* Long review words / titles must not push width past the viewport */
  .review-text,
  .review-title,
  .product-description,
  #product-full-description {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* --- Small phones (<= 480px): tighten spacing and type further --- */
@media (max-width: 480px) {
  .product-gallery,
  .product-page-details,
  .product-page-options {
    padding: 12px;
  }

  .product-page-header h2,
  #product-name {
    font-size: 18px;
  }

  .product-container-price {
    font-size: 1.375rem;
  }

  .thumbnail-wrapper {
    width: 56px;
    height: 56px;
  }

  .similar-products-header h3,
  .product-more-products h2 {
    font-size: 16px;
  }

  .review-summary,
  .review-list {
    padding: 12px;
  }

  /* Hide product-suggestion sections on phones — they hog the screen and
     push the reviews/details far down. Visible again >=769px (desktop). */
  .similar-products,
  .product-more-products {
    display: none;
  }
}

/* ============================================================
   Search / browse results page (search.html)
   Amazon-style: filter rail + 5-per-row grid + pagination.
   Everything here is scoped under .shop-page so it can't leak
   into the global .product-row / .product-grid rules.
   ============================================================ */
.shop-page {
  max-width: 1720px;
  margin: 0 auto;
  padding: 16px 32px 56px;
}

.shop-results-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.shop-results-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
  flex: 1 1 auto;
}
.shop-results-bar .sort-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shop-results-bar .sort-label { font-size: 14px; color: #64748b; }
.shop-results-bar .sort-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* The mobile "Filtros" button is hidden on desktop (sidebar always visible) */
.shop-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.shop-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
  align-items: start;
}

/* ── Filter sidebar ── */
.shop-sidebar {
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  padding: 18px 18px 22px;
  position: sticky;
  top: 16px;
}
.shop-sidebar-head { display: flex; align-items: center; justify-content: space-between; }
.shop-sidebar-head h2 { font-size: 16px; font-weight: 700; margin: 0 0 4px; color: #1a202c; }
.shop-sidebar-close { display: none; background: none; border: none; font-size: 18px; cursor: pointer; color: #64748b; }

.shop-filter-group { padding: 16px 0; border-bottom: 1px solid #f1f5f9; }
.shop-filter-group:last-of-type { border-bottom: none; }
.shop-filter-group h3 { font-size: 14px; font-weight: 700; color: #334155; margin: 0 0 10px; }
.shop-filter-hint { font-size: 13px; color: #94a3b8; margin: 0; }
.shop-filter-options { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }

.shop-radio, .shop-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #475569;
  cursor: pointer;
}
.shop-radio input, .shop-check input { cursor: pointer; accent-color: #f97316; }

/* Nested category radios (categories page): bold parent, indented subcategories */
.shop-radio-cat { font-weight: 600; color: #334155; }
.shop-radio-sub { padding-left: 22px; font-size: 13px; }

.shop-price-inputs { display: flex; align-items: center; gap: 8px; }
.shop-price-inputs input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}
.shop-price-inputs span { color: #94a3b8; }

/* "Tu País" flag block (matches the categories page) */
.shop-country { display: flex; flex-direction: column; gap: 8px; }
.shop-flag.fi {
  width: 56px;
  height: 38px;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  background-size: cover;
}

/* Rating filter rows (clickable, pretty stars) */
.shop-rating-list { display: flex; flex-direction: column; gap: 2px; }
.shop-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #475569;
  text-align: left;
  width: 100%;
}
.shop-rating-row:hover { background: #fff7ed; }
.shop-rating-row.active { background: #fff7ed; box-shadow: inset 0 0 0 1px #fdba74; }
.shop-rating-row .shop-stars { display: inline-flex; gap: 2px; font-size: 15px; }
.shop-rating-row .shop-stars .fa-star { color: #ffa41c; }
.shop-rating-row .shop-stars .far.fa-star { color: #d6d6d6; }
.shop-rating-row .shop-rating-more { color: #64748b; font-size: 12px; }
.shop-rating-new { font-weight: 600; color: #334155; }

.shop-sidebar-actions { margin-top: 18px; }
.shop-clear-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.shop-clear-btn:hover { background: #f8fafc; }

.shop-sidebar-backdrop { display: none; }

/* ── Results column ── */
.shop-result-count { font-size: 14px; color: #64748b; margin: 0 0 16px; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  transition: opacity .15s ease;
}
.shop-grid.is-loading { opacity: .45; pointer-events: none; }
.shop-grid .product-group,
.shop-grid .product-group-minimal {
  margin: 0;
  width: auto;
  display: block;
}
/* ── Results card (categories-style: borderless, full-bleed image) ── */
.shop-grid .shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.shop-grid .shop-card:hover {
  border-color: #e0e0e0;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  transform: translateY(-3px);
}

/* Image is the hero: full-bleed across the card top, not boxed in a frame */
.shop-grid .shop-card-media { position: relative; display: block; }
.shop-grid .product-card-header {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  margin: 0;
  padding: 0;
}
.shop-grid .product-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 0;
  margin: 0;
  overflow: hidden;
}
.shop-grid .product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;         /* fill the tile edge-to-edge (matches categories) */
  transition: transform .3s ease;
}
.shop-grid .shop-card:hover .product-card-image img { transform: scale(1.04); }

.shop-out-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: rgba(17,17,17,.78);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
}
.shop-grid .shop-card.is-out .product-card-image img { opacity: .55; }

/* Card body */
.shop-grid .product-card-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 14px 14px;
}
.shop-grid .product-card-store { padding: 0; margin-bottom: 4px; }
.shop-grid .product-card-store h5 {
  font-size: 12px;
  font-weight: 500;
  color: #007185;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-grid .product-card-name { padding: 0; margin-bottom: 4px; }
.shop-grid .product-card-name h4 {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: #111;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 40px;
}

.shop-grid .product-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 4px;
}
.shop-grid .shop-price-current { font-size: 20px; font-weight: 700; color: #111; }
.shop-grid .shop-price-original { font-size: 13px; color: #94a3b8; text-decoration: line-through; }

.shop-grid .rating.cart-item { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.shop-grid .shop-card-stars { display: inline-flex; gap: 2px; font-size: 13px; }
.shop-grid .shop-card-stars .fas.fa-star { color: #ffa41c; }
.shop-grid .shop-card-stars .far.fa-star { color: #d6d6d6; }
.shop-grid .review-count-text { color: #007185; font-size: 12px; margin: 0; }

.shop-grid .product-card-delivery { padding: 0; margin-bottom: 2px; }
.shop-free-ship { font-size: 12.5px; font-weight: 600; color: #067d62; }
.shop-std-ship { font-size: 12.5px; color: #565959; }
.shop-stock-low { font-size: 12px; font-weight: 600; color: #c0392b; margin-top: 2px; }

/* Comprar button pinned to the bottom of every card */
.shop-buy-btn {
  margin-top: auto;       /* pin to the bottom of the card */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: #ffd814;
  color: #0f1111;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.shop-grid .product-card-delivery,
.shop-grid .shop-stock-low { margin-bottom: 10px; }
.shop-buy-btn:hover { background: #f7ca00; }
.shop-buy-btn:disabled { background: #ededed; color: #8a8a8a; cursor: not-allowed; }

/* Toast (styled inline only on the homepage; provide it here too) */
.cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 4000;
  padding: 12px 22px;
  border-radius: 10px;
  background: #067d62;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.cart-toast.error { background: #c0392b; }
.cart-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Pagination ── */
.shop-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 36px;
}
.shop-page-link {
  min-width: 38px;
  padding: 8px 12px;
  text-align: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #334155;
  font-size: 14px;
  text-decoration: none;
  background: #fff;
}
.shop-page-link:hover { background: #f8fafc; }
.shop-page-link.active { background: #f97316; border-color: #f97316; color: #fff; font-weight: 700; }
.shop-page-link.disabled { color: #cbd5e1; pointer-events: none; }
.shop-page-gap { color: #94a3b8; padding: 0 4px; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .shop-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 992px) {
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .shop-page { padding: 12px 16px 40px; }
  .shop-filter-toggle { display: inline-flex; }
  .shop-layout { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

  /* Sidebar becomes a slide-in drawer */
  .shop-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 84%;
    max-width: 320px;
    z-index: 1200;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .shop-sidebar.open { transform: translateX(0); }
  .shop-sidebar-close { display: block; }
  .shop-sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1100;
  }
}
@media (max-width: 420px) {
  .shop-grid { grid-template-columns: 1fr; }
}
