/**
 * Starter Developer Theme - WooCommerce Styles
 */

/* ====================================
   PRODUCT GRID
   ==================================== */
.starter-products-grid {
  display: grid;
  gap: var(--starter-spacing-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.starter-products-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.starter-products-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.starter-products-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.starter-products-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.starter-products-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

/* WooCommerce default product grid */
.woocommerce ul.products {
  display: grid !important;
  gap: var(--starter-spacing-lg);
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  grid-auto-flow: dense !important;
}

/* Fix for empty space - hide pseudo elements */
.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none !important;
  content: none !important;
}

.woocommerce ul.products.columns-2 { grid-template-columns: repeat(2, 1fr); }
.woocommerce ul.products.columns-3 { grid-template-columns: repeat(3, 1fr); }
.woocommerce ul.products.columns-4 { grid-template-columns: repeat(4, 1fr); }
.woocommerce ul.products.columns-5 { grid-template-columns: repeat(5, 1fr); }
.woocommerce ul.products.columns-6 { grid-template-columns: repeat(6, 1fr); }

.woocommerce ul.products li.product {
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  width: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* Hide non-product list items and empty items */
.woocommerce ul.products > li:not(.product),
.woocommerce ul.products > li:empty,
.woocommerce ul.products li[style*="visibility: hidden"] {
  display: none !important;
}

/* Related products grid fix */
.woocommerce .related.products ul.products,
.woocommerce .up-sells ul.products,
.woocommerce .cross-sells ul.products {
  grid-auto-flow: dense !important;
}

/* Shortcode products grid fix */
.woocommerce .woocommerce-products-shortcode ul.products,
[class*="wc-block-"] ul.products,
.wp-block-woocommerce-product-collection ul.products {
  grid-auto-flow: dense !important;
}

/* Products inside custom containers (e.g., Tailwind sections) */
div > .woocommerce ul.products,
section > .woocommerce ul.products,
article .woocommerce ul.products {
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure product cards fill available space */
.woocommerce ul.products li.product .starter-product-card {
  height: 100%;
}

/* ====================================
   SHORTCODE PRODUCTS - ENHANCED LAYOUT
   ==================================== */
/* Shortcode wrapper should be full width with proper container */
.woocommerce.columns-2,
.woocommerce.columns-3,
.woocommerce.columns-4,
.woocommerce.columns-5,
.woocommerce.columns-6 {
  width: 100%;
  max-width: var(--starter-container-width, 1200px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--starter-spacing-md, 16px);
  padding-right: var(--starter-spacing-md, 16px);
  box-sizing: border-box;
}

/* Shortcode product images - better aspect ratio, NOT too zoomed */
.woocommerce ul.products .starter-product-card__image img,
.starter-products-grid .starter-product-card__image img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: #fff;
  padding: 8px;
}

/* Alternative: Cover mode with slight zoom */
.starter-products-grid--cover .starter-product-card__image img,
.woocommerce.products-cover ul.products .starter-product-card__image img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  padding: 0;
}

/* Ensure proper spacing in shortcode grids */
.woocommerce ul.products {
  gap: 20px;
}

/* Better card shadows for shortcode products */
article .woocommerce ul.products .starter-product-card,
section .woocommerce ul.products .starter-product-card,
div .woocommerce ul.products .starter-product-card,
.starter-page--raw .woocommerce .starter-product-card,
.starter-products-grid .starter-product-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: var(--starter-radius, 12px);
  background: #fff;
}

article .woocommerce ul.products .starter-product-card:hover,
section .woocommerce ul.products .starter-product-card:hover,
div .woocommerce ul.products .starter-product-card:hover,
.starter-page--raw .woocommerce .starter-product-card:hover,
.starter-products-grid .starter-product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Fix for pages without container (raw shortcode pages) */
.starter-page--raw .woocommerce,
.starter-main--no-card .woocommerce {
  max-width: var(--starter-container-width, 1200px);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--starter-spacing-md, 16px);
}

/* Ensure grid displays correctly on raw pages */
.starter-page--raw .woocommerce ul.products,
.starter-main--no-card .woocommerce ul.products {
  display: grid !important;
  gap: 20px !important;
}

.starter-page--raw .woocommerce ul.products.columns-2,
.starter-main--no-card .woocommerce ul.products.columns-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}

.starter-page--raw .woocommerce ul.products.columns-3,
.starter-main--no-card .woocommerce ul.products.columns-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}

.starter-page--raw .woocommerce ul.products.columns-4,
.starter-main--no-card .woocommerce ul.products.columns-4 {
  grid-template-columns: repeat(4, 1fr) !important;
}

.starter-page--raw .woocommerce ul.products.columns-5,
.starter-main--no-card .woocommerce ul.products.columns-5 {
  grid-template-columns: repeat(5, 1fr) !important;
}

.starter-page--raw .woocommerce ul.products.columns-6,
.starter-main--no-card .woocommerce ul.products.columns-6 {
  grid-template-columns: repeat(6, 1fr) !important;
}

/* Ensure products fill their grid cells */
.starter-page--raw .woocommerce ul.products li.product,
.starter-main--no-card .woocommerce ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Shortcode container wrapper */
.starter-shortcode-container {
  max-width: var(--starter-container-width, 1200px);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--starter-spacing-md, 16px);
  box-sizing: border-box;
}

/* ====================================
   ENHANCED SHORTCODE GRID OPTIONS
   ==================================== */
/* Image mode: contain (default) - shows full product without cropping */
.starter-products-grid--image-contain .starter-product-card__image img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background-color: #f8f9fa;
  padding: 8px;
}

/* Image mode: cover - crops to fill, more visual impact */
.starter-products-grid--image-cover .starter-product-card__image img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  padding: 0;
  background: none;
}

/* Card style: default */
.starter-products-grid--style-default .starter-product-card {
  background: #fff;
  border-radius: var(--starter-radius, 12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.starter-products-grid--style-default .starter-product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Card style: minimal */
.starter-products-grid--style-minimal .starter-product-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.starter-products-grid--style-minimal .starter-product-card:hover {
  transform: none;
  box-shadow: none;
}

.starter-products-grid--style-minimal .starter-product-card__image {
  border-radius: var(--starter-radius, 12px);
  overflow: hidden;
}

/* Card style: bordered */
.starter-products-grid--style-bordered .starter-product-card {
  background: #fff;
  border-radius: var(--starter-radius, 12px);
  box-shadow: none;
  border: 2px solid var(--starter-border-color, #e5e7eb);
}

.starter-products-grid--style-bordered .starter-product-card:hover {
  border-color: var(--starter-primary, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Title line limits */
.starter-product-card__title--lines-1 a {
  -webkit-line-clamp: 1;
}

.starter-product-card__title--lines-2 a {
  -webkit-line-clamp: 2;
}

/* Rating display */
.starter-product-card__rating {
  margin-bottom: 6px;
}

.starter-product-card__rating .star-rating {
  font-size: 12px;
}

/* Mobile column variants */
.starter-products-grid--mobile-cols-1 {
  /* Will be set via media query */
}

.starter-products-grid--mobile-cols-2 {
  /* Default mobile behavior */
}

.starter-products-grid--mobile-cols-3 {
  /* Will be set via media query */
}

/* ====================================
   PRODUCT CARD
   ==================================== */
.starter-product-card {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  overflow: hidden;
  box-shadow: var(--starter-shadow);
  transition: var(--starter-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.starter-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--starter-shadow-lg);
}

/* Product Image */
.starter-product-card__image {
  position: relative;
  overflow: hidden;
  background: var(--starter-background);
}

.starter-product-card__image a {
  display: block;
}

.starter-product-card__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.starter-product-card:hover .starter-product-card__image img {
  transform: scale(1.05);
}

/* Sale Badge */
.starter-product-card__badge {
  position: absolute;
  top: var(--starter-spacing-sm);
  left: var(--starter-spacing-sm);
  padding: 4px 10px;
  font-size: var(--starter-font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--starter-radius-sm);
  z-index: 5;
}

.starter-product-card__badge--sale {
  background: var(--starter-error);
  color: #fff;
}

/* Product Actions */
.starter-product-card__actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--starter-spacing-md);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  justify-content: center;
  gap: var(--starter-spacing-sm);
  opacity: 0;
  transform: translateY(10px);
  transition: var(--starter-transition);
}

.starter-product-card:hover .starter-product-card__actions {
  opacity: 1;
  transform: translateY(0);
}

.starter-product-card__add-to-cart {
  width: 44px;
  height: 44px;
  padding: 0;
  background: #fff;
  color: var(--starter-text-primary);
  border: none;
  border-radius: var(--starter-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--starter-transition);
}

.starter-product-card__add-to-cart:hover {
  background: var(--starter-primary);
  color: #fff;
  transform: scale(1.1);
}

.starter-product-card__add-to-cart svg {
  width: 20px;
  height: 20px;
}

.starter-product-card__select-options {
  padding: 10px 16px;
  background: #fff;
  color: var(--starter-text-primary);
  border-radius: var(--starter-radius-sm);
  font-size: var(--starter-font-size-sm);
  font-weight: 600;
  text-decoration: none;
}

.starter-product-card__select-options:hover {
  background: var(--starter-primary);
  color: #fff;
}

/* Product Content */
.starter-product-card__content {
  padding: var(--starter-spacing-md);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.starter-product-card__title {
  font-size: var(--starter-font-size-base);
  font-weight: 600;
  margin: 0 0 var(--starter-spacing-sm) 0;
  line-height: 1.4;
}

.starter-product-card__title a {
  color: var(--starter-text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.starter-product-card__title a:hover {
  color: var(--starter-primary);
}

.starter-product-card__price {
  font-size: var(--starter-font-size-lg);
  font-weight: 700;
  color: var(--starter-text-primary);
  margin-top: auto;
}

.starter-product-card__price del {
  color: var(--starter-text-muted);
  font-size: var(--starter-font-size-sm);
  font-weight: 400;
  margin-right: var(--starter-spacing-xs);
}

.starter-product-card__price ins {
  text-decoration: none;
  color: var(--starter-error);
}

/* ====================================
   SHOP PAGE
   ==================================== */
.starter-woocommerce {
  padding: var(--starter-spacing-xl) 0;
}

.woocommerce-products-header {
  margin-bottom: var(--starter-spacing-xl);
}

.woocommerce-products-header__title {
  font-size: var(--starter-font-size-3xl);
  margin: 0 0 var(--starter-spacing-sm) 0;
}

.term-description {
  color: var(--starter-text-secondary);
  max-width: 700px;
}

/* Result Count & Ordering */
.woocommerce-result-count,
.woocommerce-ordering {
  margin-bottom: var(--starter-spacing-lg);
}

.woocommerce-ordering select {
  min-width: 200px;
  padding: var(--starter-spacing-sm) var(--starter-spacing-md);
  border: 2px solid var(--starter-border-color);
  border-radius: var(--starter-radius-sm);
  background: #fff;
}

/* Pagination */
.woocommerce-pagination {
  margin-top: var(--starter-spacing-xl);
}

.woocommerce-pagination ul {
  display: flex;
  justify-content: center;
  gap: var(--starter-spacing-sm);
  list-style: none;
  padding: 0;
  margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 var(--starter-spacing-md);
  background: var(--starter-card-bg);
  color: var(--starter-text-secondary);
  border: 2px solid var(--starter-border-color);
  border-radius: var(--starter-radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: var(--starter-transition);
}

.woocommerce-pagination ul li a:hover {
  border-color: var(--starter-primary);
  color: var(--starter-primary);
}

.woocommerce-pagination ul li span.current {
  background: var(--starter-primary);
  border-color: var(--starter-primary);
  color: #fff;
}

/* ====================================
   SINGLE PRODUCT
   ==================================== */
.starter-single-product-wrapper {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-xl);
  box-shadow: var(--starter-shadow);
  margin-bottom: var(--starter-spacing-xl);
}

/* Product Gallery */
.woocommerce div.product div.images {
  width: 50%;
  float: left;
  padding-right: var(--starter-spacing-xl);
}

.woocommerce div.product div.images .woocommerce-product-gallery__image img {
  border-radius: var(--starter-radius);
}

.woocommerce div.product div.images .flex-control-thumbs {
  display: flex;
  gap: var(--starter-spacing-sm);
  margin-top: var(--starter-spacing-md);
  list-style: none;
  padding: 0;
}

.woocommerce div.product div.images .flex-control-thumbs li {
  flex: 0 0 calc(25% - 6px);
}

.woocommerce div.product div.images .flex-control-thumbs li img {
  border-radius: var(--starter-radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--starter-transition);
}

.woocommerce div.product div.images .flex-control-thumbs li img:hover,
.woocommerce div.product div.images .flex-control-thumbs li img.flex-active {
  border-color: var(--starter-primary);
}

/* Product Summary */
.woocommerce div.product div.summary {
  width: 50%;
  float: right;
  padding-left: var(--starter-spacing-xl);
}

.woocommerce div.product .product_title {
  font-size: var(--starter-font-size-3xl);
  margin: 0 0 var(--starter-spacing-md) 0;
}

.woocommerce div.product p.price {
  font-size: var(--starter-font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--starter-spacing-lg);
}

.woocommerce div.product p.price del {
  font-size: var(--starter-font-size-lg);
  color: var(--starter-text-muted);
  font-weight: 400;
}

.woocommerce div.product p.price ins {
  text-decoration: none;
  color: var(--starter-error);
}

.woocommerce div.product .woocommerce-product-details__short-description {
  color: var(--starter-text-secondary);
  margin-bottom: var(--starter-spacing-lg);
  line-height: 1.7;
}

/* Add to Cart Form */
.woocommerce div.product form.cart {
  display: flex;
  align-items: stretch;
  gap: var(--starter-spacing-md);
  margin-bottom: var(--starter-spacing-lg);
}

.woocommerce div.product form.cart .quantity {
  display: flex;
  align-items: center;
}

.woocommerce div.product form.cart .quantity .qty {
  width: 80px;
  height: 50px;
  text-align: center;
  font-weight: 600;
  border: 2px solid var(--starter-border-color);
  border-radius: var(--starter-radius-sm);
}

.woocommerce div.product form.cart button.single_add_to_cart_button {
  flex: 1;
  height: 50px;
  font-size: var(--starter-font-size-base);
}

/* Product Meta */
.woocommerce div.product .product_meta {
  background: var(--starter-background);
  padding: var(--starter-spacing-lg);
  border-radius: var(--starter-radius-sm);
  margin-top: var(--starter-spacing-lg);
}

.woocommerce div.product .product_meta > span {
  display: block;
  margin-bottom: var(--starter-spacing-sm);
  color: var(--starter-text-secondary);
  font-size: var(--starter-font-size-sm);
}

.woocommerce div.product .product_meta > span:last-child {
  margin-bottom: 0;
}

.woocommerce div.product .product_meta a {
  color: var(--starter-primary);
  font-weight: 500;
}

/* Variations */
.woocommerce div.product form.cart .variations {
  margin-bottom: var(--starter-spacing-lg);
  width: 100%;
}

.woocommerce div.product form.cart .variations tr {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--starter-spacing-md);
}

.woocommerce div.product form.cart .variations td.label {
  padding: 0 0 var(--starter-spacing-xs) 0;
}

.woocommerce div.product form.cart .variations td.label label {
  font-weight: 600;
  color: var(--starter-text-primary);
}

.woocommerce div.product form.cart .variations select {
  width: 100%;
  padding: var(--starter-spacing-sm) var(--starter-spacing-md);
}

/* Tabs */
.woocommerce div.product .woocommerce-tabs {
  clear: both;
  padding-top: var(--starter-spacing-xl);
  margin-top: var(--starter-spacing-xl);
  border-top: 1px solid var(--starter-border-color);
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--starter-spacing-lg) 0;
  gap: var(--starter-spacing-sm);
  border-bottom: 2px solid var(--starter-border-color);
}

.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs::after {
  display: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  display: block;
  padding: var(--starter-spacing-md) var(--starter-spacing-lg);
  color: var(--starter-text-secondary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--starter-transition);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
  color: var(--starter-primary);
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--starter-primary);
  border-bottom-color: var(--starter-primary);
}

.woocommerce div.product .woocommerce-tabs .panel {
  padding: var(--starter-spacing-lg) 0;
}

.woocommerce div.product .woocommerce-tabs .panel h2 {
  font-size: var(--starter-font-size-xl);
  margin-bottom: var(--starter-spacing-lg);
}

/* Related Products */
.woocommerce div.product section.related.products,
.woocommerce div.product section.upsells.products,
.woocommerce div.product .related.products,
.woocommerce div.product .upsells.products {
  margin-top: var(--starter-spacing-2xl);
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-xl);
  box-shadow: var(--starter-shadow);
  /* IMPORTANT: Block layout to stack title above products */
  display: block !important;
  width: 100% !important;
}

.woocommerce div.product section.related.products h2,
.woocommerce div.product section.upsells.products h2,
.woocommerce div.product .related.products > h2,
.woocommerce div.product .upsells.products > h2 {
  font-size: var(--starter-font-size-2xl);
  margin-bottom: var(--starter-spacing-lg);
  display: block !important;
  width: 100% !important;
  text-align: center;
}

/* Ensure the products grid comes AFTER the title */
.woocommerce div.product section.related.products ul.products,
.woocommerce div.product section.upsells.products ul.products,
.woocommerce div.product .related.products ul.products,
.woocommerce div.product .upsells.products ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: var(--starter-spacing-lg) !important;
  margin-top: var(--starter-spacing-md);
  width: 100% !important;
}

.woocommerce div.product section.related.products ul.products li.product,
.woocommerce div.product section.upsells.products ul.products li.product,
.woocommerce div.product .related.products ul.products li.product,
.woocommerce div.product .upsells.products ul.products li.product {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
}

/* Responsive Related Products */
@media (max-width: 1024px) {
  .woocommerce div.product section.related.products ul.products,
  .woocommerce div.product section.upsells.products ul.products,
  .woocommerce div.product .related.products ul.products,
  .woocommerce div.product .upsells.products ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .woocommerce div.product section.related.products,
  .woocommerce div.product section.upsells.products,
  .woocommerce div.product .related.products,
  .woocommerce div.product .upsells.products {
    padding: var(--starter-spacing-md);
  }
  
  .woocommerce div.product section.related.products h2,
  .woocommerce div.product section.upsells.products h2,
  .woocommerce div.product .related.products > h2,
  .woocommerce div.product .upsells.products > h2 {
    font-size: var(--starter-font-size-xl);
    margin-bottom: var(--starter-spacing-md);
  }
  
  .woocommerce div.product section.related.products ul.products,
  .woocommerce div.product section.upsells.products ul.products,
  .woocommerce div.product .related.products ul.products,
  .woocommerce div.product .upsells.products ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--starter-spacing-md) !important;
  }
}

@media (max-width: 480px) {
  .woocommerce div.product section.related.products ul.products,
  .woocommerce div.product section.upsells.products ul.products,
  .woocommerce div.product .related.products ul.products,
  .woocommerce div.product .upsells.products ul.products {
    gap: var(--starter-spacing-sm) !important;
  }
}

/* ====================================
   CART PAGE
   ==================================== */
.woocommerce-cart .woocommerce {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--starter-spacing-xl);
  align-items: start;
  padding-top: var(--starter-spacing-xl);
}

.woocommerce-cart .woocommerce-cart-form {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-xl);
  box-shadow: var(--starter-shadow);
}

.woocommerce-cart .shop_table {
  border: none;
  background: transparent;
}

.woocommerce-cart .shop_table thead th {
  background: var(--starter-background);
  padding: var(--starter-spacing-md);
  font-weight: 600;
  color: var(--starter-text-secondary);
  text-transform: uppercase;
  font-size: var(--starter-font-size-xs);
  letter-spacing: 0.05em;
  border: none;
}

.woocommerce-cart .shop_table tbody td {
  padding: var(--starter-spacing-lg) var(--starter-spacing-md);
  border-bottom: 1px solid var(--starter-border-color);
  vertical-align: middle;
}

.woocommerce-cart .shop_table tbody tr:last-child td {
  border-bottom: none;
}

.woocommerce-cart .shop_table .product-thumbnail img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--starter-radius-sm);
}

.woocommerce-cart .shop_table .product-name a {
  color: var(--starter-text-primary);
  font-weight: 600;
  text-decoration: none;
}

.woocommerce-cart .shop_table .product-name a:hover {
  color: var(--starter-primary);
}

.woocommerce-cart .shop_table .product-remove a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--starter-error-bg);
  color: var(--starter-error);
  border-radius: var(--starter-radius-full);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}

.woocommerce-cart .shop_table .product-remove a:hover {
  background: var(--starter-error);
  color: #fff;
}

/* Cart Totals */
.woocommerce-cart .cart_totals {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-xl);
  box-shadow: var(--starter-shadow);
  position: sticky;
  top: calc(var(--starter-header-height) + var(--starter-spacing-lg));
}

.woocommerce-cart .cart_totals h2 {
  font-size: var(--starter-font-size-xl);
  margin-bottom: var(--starter-spacing-lg);
  padding-bottom: var(--starter-spacing-md);
  border-bottom: 1px solid var(--starter-border-color);
}

.woocommerce-cart .cart_totals table {
  border: none;
  background: transparent;
}

.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
  border: none;
  padding: var(--starter-spacing-sm) 0;
}

.woocommerce-cart .cart_totals .order-total th,
.woocommerce-cart .cart_totals .order-total td {
  font-size: var(--starter-font-size-lg);
  font-weight: 700;
  border-top: 2px solid var(--starter-border-color);
  padding-top: var(--starter-spacing-md);
}

.woocommerce-cart .cart_totals .wc-proceed-to-checkout a {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: var(--starter-spacing-lg);
  padding: var(--starter-spacing-md) var(--starter-spacing-lg);
  font-size: var(--starter-font-size-base);
}

/* Proceed to Checkout Button - Always Primary Color with Round Edges */
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce .wc-proceed-to-checkout a.checkout-button,
.cart-collaterals .wc-proceed-to-checkout a.checkout-button,
a.checkout-button.wc-forward {
  background-color: var(--starter-primary, #2563eb) !important;
  color: #fff !important;
  border-radius: var(--starter-radius, 12px) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  border: none !important;
  transition: var(--starter-transition) !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce .wc-proceed-to-checkout a.checkout-button:hover,
.cart-collaterals .wc-proceed-to-checkout a.checkout-button:hover,
a.checkout-button.wc-forward:hover {
  background-color: var(--starter-primary-hover, #1d4ed8) !important;
  transform: translateY(-2px);
  box-shadow: var(--starter-shadow-lg);
}

/* ====================================
   CHECKOUT PAGE
   ==================================== */
.woocommerce-checkout .woocommerce {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: var(--starter-spacing-xl);
  align-items: start;
  padding-top: var(--starter-spacing-xl);
}

.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-additional-fields {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-xl);
  box-shadow: var(--starter-shadow);
  margin-bottom: var(--starter-spacing-lg);
}

.woocommerce-checkout h3 {
  font-size: var(--starter-font-size-xl);
  margin-bottom: var(--starter-spacing-lg);
}

.woocommerce-checkout .form-row {
  margin-bottom: var(--starter-spacing-md);
}

.woocommerce-checkout .form-row label {
  margin-bottom: var(--starter-spacing-xs);
}

.woocommerce-checkout .form-row input,
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select {
  width: 100%;
}

/* Order Review */
.woocommerce-checkout #order_review_heading {
  display: none;
}

.woocommerce-checkout #order_review {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-xl);
  box-shadow: var(--starter-shadow);
  position: sticky;
  top: calc(var(--starter-header-height) + var(--starter-spacing-lg));
}

.woocommerce-checkout .shop_table {
  border: none;
  background: transparent;
}

.woocommerce-checkout .shop_table thead th {
  background: transparent;
  border: none;
  padding: var(--starter-spacing-sm) 0;
  font-weight: 600;
}

.woocommerce-checkout .shop_table tbody td {
  border: none;
  padding: var(--starter-spacing-sm) 0;
  border-bottom: 1px solid var(--starter-border-color);
}

.woocommerce-checkout .shop_table tfoot th,
.woocommerce-checkout .shop_table tfoot td {
  border: none;
  padding: var(--starter-spacing-sm) 0;
}

.woocommerce-checkout .shop_table tfoot .order-total th,
.woocommerce-checkout .shop_table tfoot .order-total td {
  font-size: var(--starter-font-size-lg);
  font-weight: 700;
  border-top: 2px solid var(--starter-border-color);
  padding-top: var(--starter-spacing-md);
}

/* Payment Methods */
.woocommerce-checkout #payment {
  background: var(--starter-background);
  border-radius: var(--starter-radius-sm);
  margin-top: var(--starter-spacing-lg);
}

.woocommerce-checkout #payment ul.payment_methods {
  list-style: none;
  padding: var(--starter-spacing-md);
  margin: 0;
}

.woocommerce-checkout #payment ul.payment_methods li {
  margin-bottom: var(--starter-spacing-md);
}

.woocommerce-checkout #payment ul.payment_methods li:last-child {
  margin-bottom: 0;
}

.woocommerce-checkout #payment .place-order {
  padding: var(--starter-spacing-md);
}

.woocommerce-checkout #payment #place_order {
  width: 100%;
  padding: var(--starter-spacing-md) var(--starter-spacing-lg);
  font-size: var(--starter-font-size-base);
}

/* Place Order Button - Always Primary Color with Round Edges */
.woocommerce-checkout #payment #place_order,
.woocommerce #payment #place_order,
button#place_order,
#place_order {
  background-color: var(--starter-primary, #2563eb) !important;
  color: #fff !important;
  border-radius: var(--starter-radius, 12px) !important;
  font-weight: 600 !important;
  border: none !important;
  cursor: pointer !important;
  transition: var(--starter-transition) !important;
}

.woocommerce-checkout #payment #place_order:hover,
.woocommerce #payment #place_order:hover,
button#place_order:hover,
#place_order:hover {
  background-color: var(--starter-primary-hover, #1d4ed8) !important;
  transform: translateY(-2px);
  box-shadow: var(--starter-shadow-lg);
}

/* ====================================
   ORDER RECEIVED / THANK YOU PAGE
   ==================================== */
/* Order Details - Desktop Layout: All in one row */
.woocommerce-order-received .woocommerce-order-overview,
.woocommerce-thankyou-order-details,
.woocommerce ul.woocommerce-order-overview {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: var(--starter-spacing-lg) !important;
  justify-content: flex-start !important;
  background: var(--starter-card-bg, #fff);
  padding: var(--starter-spacing-lg) !important;
  border-radius: var(--starter-radius, 12px);
  box-shadow: var(--starter-shadow);
  margin-bottom: var(--starter-spacing-xl) !important;
  list-style: none !important;
}

.woocommerce-order-received .woocommerce-order-overview li,
.woocommerce-thankyou-order-details li,
.woocommerce ul.woocommerce-order-overview li {
  flex: 1 1 auto !important;
  min-width: 150px !important;
  padding: var(--starter-spacing-md) !important;
  background: var(--starter-background, #f3f4f6) !important;
  border-radius: var(--starter-radius-sm, 6px) !important;
  text-align: center !important;
  margin: 0 !important;
  border-right: none !important;
}

.woocommerce-order-received .woocommerce-order-overview li strong,
.woocommerce-thankyou-order-details li strong,
.woocommerce ul.woocommerce-order-overview li strong {
  display: block !important;
  font-size: var(--starter-font-size-lg, 18px) !important;
  color: var(--starter-primary, #2563eb) !important;
  margin-top: var(--starter-spacing-xs, 4px) !important;
}

/* ====================================
   MY ACCOUNT PAGE - IMPROVED DESKTOP LAYOUT
   ==================================== */
.woocommerce-account .woocommerce {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--starter-spacing-xl);
  align-items: start;
  padding-top: var(--starter-spacing-xl);
  max-width: 1200px;
  margin: 0 auto;
}

.woocommerce-account .woocommerce-MyAccount-navigation {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-lg);
  box-shadow: var(--starter-shadow);
  position: sticky;
  top: calc(var(--starter-header-height, 70px) + var(--starter-spacing-lg));
}

.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li {
  margin-bottom: var(--starter-spacing-xs);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
  display: flex;
  align-items: center;
  gap: var(--starter-spacing-sm);
  padding: var(--starter-spacing-md) var(--starter-spacing-lg);
  color: var(--starter-text-secondary);
  border-radius: var(--starter-radius-sm);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--starter-font-size-base);
  transition: var(--starter-transition);
  border: 1px solid transparent;
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
  background: var(--starter-background, #f3f4f6);
  color: var(--starter-primary);
  border-color: var(--starter-border-color, #e5e7eb);
}

.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--dashboard.is-active a {
  background: var(--starter-primary);
  color: #fff;
  border-color: var(--starter-primary);
}

.woocommerce-account .woocommerce-MyAccount-content {
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  padding: var(--starter-spacing-xl);
  box-shadow: var(--starter-shadow);
  min-height: 400px;
}

/* My Account Content Typography */
.woocommerce-account .woocommerce-MyAccount-content > p:first-child {
  font-size: var(--starter-font-size-lg);
  line-height: 1.7;
  color: var(--starter-text-secondary);
  margin-bottom: var(--starter-spacing-lg);
}

.woocommerce-account .woocommerce-MyAccount-content mark {
  background: transparent;
  color: var(--starter-primary);
  font-weight: 600;
}

/* My Account Dashboard Welcome Message */
.woocommerce-account .woocommerce-MyAccount-content > p:first-of-type strong {
  color: var(--starter-text-primary);
  font-weight: 700;
}

/* My Account Tables */
.woocommerce-account .woocommerce-MyAccount-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--starter-spacing-lg);
}

.woocommerce-account .woocommerce-MyAccount-content table thead th {
  background: var(--starter-background, #f3f4f6);
  padding: var(--starter-spacing-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--starter-font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--starter-text-secondary);
  border: none;
}

.woocommerce-account .woocommerce-MyAccount-content table tbody td {
  padding: var(--starter-spacing-md);
  border-bottom: 1px solid var(--starter-border-color, #e5e7eb);
  vertical-align: middle;
}

.woocommerce-account .woocommerce-MyAccount-content table tbody tr:last-child td {
  border-bottom: none;
}

/* My Account Addresses */
.woocommerce-account .woocommerce-Addresses {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--starter-spacing-xl);
}

.woocommerce-account .woocommerce-Address {
  background: var(--starter-background, #f3f4f6);
  padding: var(--starter-spacing-lg);
  border-radius: var(--starter-radius-sm);
}

.woocommerce-account .woocommerce-Address header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--starter-spacing-md);
  padding-bottom: var(--starter-spacing-md);
  border-bottom: 1px solid var(--starter-border-color, #e5e7eb);
}

.woocommerce-account .woocommerce-Address header h3 {
  margin: 0;
  font-size: var(--starter-font-size-lg);
}

.woocommerce-account .woocommerce-Address header a {
  font-size: var(--starter-font-size-sm);
  color: var(--starter-primary);
}

.woocommerce-account .woocommerce-Address address {
  font-style: normal;
  line-height: 1.7;
  color: var(--starter-text-secondary);
}

/* ====================================
   CATEGORIES GRID
   ==================================== */
.starter-categories-grid {
  display: grid;
  gap: var(--starter-spacing-lg);
}

.starter-categories-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.starter-categories-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.starter-categories-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.starter-categories-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.starter-categories-grid--cols-6 { grid-template-columns: repeat(6, 1fr); }

.starter-category-card {
  display: block;
  background: var(--starter-card-bg);
  border-radius: var(--starter-radius);
  overflow: hidden;
  box-shadow: var(--starter-shadow);
  text-decoration: none;
  transition: var(--starter-transition);
}

.starter-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--starter-shadow-lg);
}

.starter-category-card__image {
  position: relative;
  overflow: hidden;
}

.starter-category-card__image img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.starter-category-card:hover .starter-category-card__image img {
  transform: scale(1.05);
}

.starter-category-card__content {
  padding: var(--starter-spacing-md);
  text-align: center;
}

.starter-category-card__title {
  font-size: var(--starter-font-size-lg);
  font-weight: 600;
  margin: 0 0 var(--starter-spacing-xs) 0;
  color: var(--starter-text-primary);
}

.starter-category-card__count {
  font-size: var(--starter-font-size-sm);
  color: var(--starter-text-muted);
}

/* ====================================
   BREADCRUMB
   ==================================== */
.starter-breadcrumb {
  background: var(--starter-card-bg);
  padding: var(--starter-spacing-md) 0;
  margin-bottom: var(--starter-spacing-lg);
  border-bottom: 1px solid var(--starter-border-color);
}

.starter-breadcrumb__item {
  color: var(--starter-text-secondary);
  font-size: var(--starter-font-size-sm);
}

.starter-breadcrumb__item a {
  color: var(--starter-text-secondary);
  text-decoration: none;
}

.starter-breadcrumb__item a:hover {
  color: var(--starter-primary);
}

.starter-breadcrumb__separator {
  margin: 0 var(--starter-spacing-sm);
  color: var(--starter-text-muted);
}

/* ====================================
   MESSAGES
   ==================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  padding: var(--starter-spacing-md) var(--starter-spacing-lg);
  margin-bottom: var(--starter-spacing-lg);
  border-radius: var(--starter-radius-sm);
  display: flex;
  align-items: center;
  gap: var(--starter-spacing-md);
}

.woocommerce-message {
  background: var(--starter-success-bg);
  color: var(--starter-success);
  border-left: 4px solid var(--starter-success);
}

.woocommerce-info {
  background: rgba(37, 99, 235, 0.1);
  color: var(--starter-primary);
  border-left: 4px solid var(--starter-primary);
}

.woocommerce-error {
  background: var(--starter-error-bg);
  color: var(--starter-error);
  border-left: 4px solid var(--starter-error);
}

.woocommerce-message a.button,
.woocommerce-info a.button {
  margin-left: auto;
}

/* ====================================
   PRODUCT CAROUSEL/SLIDER MOBILE FIXES
   ==================================== */
/* Fix for product carousels/sliders on mobile - prevent overlap */
@media (max-width: 768px) {
  /* Generic slider/carousel fixes */
  .swiper-wrapper,
  .slick-track,
  .owl-stage,
  .carousel-inner,
  .products-carousel,
  .product-carousel,
  [class*="carousel"] .products,
  [class*="slider"] .products {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
  }
  
  /* Product cards inside carousels */
  .swiper-slide,
  .slick-slide,
  .owl-item,
  .carousel-item,
  [class*="carousel"] .products li.product,
  [class*="slider"] .products li.product {
    flex: 0 0 45% !important;
    max-width: 45% !important;
    min-width: 140px !important;
    width: auto !important;
    position: relative !important;
    float: none !important;
    margin: 0 !important;
  }
  
  /* Swiper-specific fixes */
  .swiper-container,
  .swiper {
    overflow: hidden !important;
  }
  
  .swiper-wrapper {
    transform: none !important;
  }
  
  /* Products that use absolute positioning - fix overlap */
  .products .product[style*="position: absolute"],
  .products .product[style*="left:"],
  .products .product[style*="transform"] {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
  }
  
  /* Product cards in any carousel container */
  .woocommerce [class*="carousel"] ul.products,
  .woocommerce [class*="slider"] ul.products,
  .woocommerce [class*="featured"] ul.products,
  .woocommerce [class*="swiper"] ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 12px !important;
    padding-bottom: 16px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  
  .woocommerce [class*="carousel"] ul.products::-webkit-scrollbar,
  .woocommerce [class*="slider"] ul.products::-webkit-scrollbar,
  .woocommerce [class*="featured"] ul.products::-webkit-scrollbar,
  .woocommerce [class*="swiper"] ul.products::-webkit-scrollbar {
    display: none !important;
  }
  
  .woocommerce [class*="carousel"] ul.products li.product,
  .woocommerce [class*="slider"] ul.products li.product,
  .woocommerce [class*="featured"] ul.products li.product,
  .woocommerce [class*="swiper"] ul.products li.product {
    flex: 0 0 46% !important;
    max-width: 46% !important;
    scroll-snap-align: start !important;
    transform: none !important;
    position: relative !important;
  }
  
  /* Fix for Elementor product widgets */
  .elementor-widget-woocommerce-products ul.products,
  .elementor-widget-wc-products ul.products,
  .elementor-products ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 12px !important;
  }
  
  .elementor-widget-woocommerce-products ul.products li.product,
  .elementor-widget-wc-products ul.products li.product,
  .elementor-products ul.products li.product {
    flex: 0 0 46% !important;
    max-width: 46% !important;
    scroll-snap-align: start !important;
  }
  
  /* Fix product card inner layout */
  .woocommerce ul.products li.product .starter-product-card,
  .woocommerce ul.products li.product > a,
  .woocommerce ul.products li.product > .woocommerce-LoopProduct-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }
  
  /* Product image container */
  .woocommerce ul.products li.product img,
  .woocommerce ul.products li.product .attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
  }
  
  /* Product title - truncate */
  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce ul.products li.product h2 {
    font-size: 13px !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin: 8px 0 4px !important;
  }
  
  /* Product price */
  .woocommerce ul.products li.product .price {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  
  /* Add to cart button in carousels */
  .woocommerce ul.products li.product .add_to_cart_button,
  .woocommerce ul.products li.product .product_type_variable {
    font-size: 11px !important;
    padding: 8px 10px !important;
    margin-top: auto !important;
  }
  
  /* Hide long button text, show icon only */
  .woocommerce ul.products li.product .add_to_cart_button {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 1024px) {
  .starter-products-grid--cols-5,
  .starter-products-grid--cols-6,
  .woocommerce ul.products.columns-5,
  .woocommerce ul.products.columns-6 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .starter-categories-grid--cols-5,
  .starter-categories-grid--cols-6 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .starter-products-grid--cols-3,
  .starter-products-grid--cols-4,
  .starter-products-grid--cols-5,
  .starter-products-grid--cols-6,
  .woocommerce ul.products.columns-3,
  .woocommerce ul.products.columns-4,
  .woocommerce ul.products.columns-5,
  .woocommerce ul.products.columns-6 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .starter-categories-grid--cols-3,
  .starter-categories-grid--cols-4,
  .starter-categories-grid--cols-5,
  .starter-categories-grid--cols-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Shortcode pages on mobile */
  .starter-page--raw .woocommerce ul.products,
  .starter-main--no-card .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 0 !important;
  }
  
  .starter-page--raw .woocommerce,
  .starter-main--no-card .woocommerce {
    padding: 0 12px !important;
  }
  
  /* Single Product */
  .woocommerce div.product div.images,
  .woocommerce div.product div.summary {
    width: 100%;
    float: none;
    padding: 0;
  }
  
  .woocommerce div.product div.images {
    margin-bottom: var(--starter-spacing-xl);
  }
  
  /* Cart */
  .woocommerce-cart .woocommerce {
    grid-template-columns: 1fr;
  }
  
  .woocommerce-cart .cart_totals {
    position: static;
  }
  
  /* Checkout */
  .woocommerce-checkout .woocommerce {
    grid-template-columns: 1fr;
  }
  
  .woocommerce-checkout #order_review {
    position: static;
  }
  
  /* Account */
  .woocommerce-account .woocommerce {
    grid-template-columns: 1fr;
  }
  /* Mobile column variants */
  .starter-products-grid--mobile-cols-1 {
    grid-template-columns: 1fr !important;
  }
  
  .starter-products-grid--mobile-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .starter-products-grid--mobile-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  /* Shortcode container on tablet */
  .starter-shortcode-container {
    padding: 0 12px;
  }
}

@media (max-width: 480px) {
  .starter-products-grid,
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  
  /* Mobile column variants */
  .starter-products-grid--mobile-cols-1 {
    grid-template-columns: 1fr !important;
  }
  
  .starter-products-grid--mobile-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  .starter-products-grid--mobile-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  
  /* Shortcode container on mobile */
  .starter-shortcode-container {
    padding: 0 10px;
  }
  
  .starter-categories-grid {
    grid-template-columns: 1fr !important;
  }
  
  .starter-product-card {
    border-radius: 10px;
    overflow: hidden;
  }
  
  /* Better image sizing on mobile - not too zoomed */
  .starter-product-card__image img {
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    background-color: #f8f9fa;
    padding: 6px;
  }
  
  .starter-product-card__content {
    padding: 10px;
  }
  
  .starter-product-card__title {
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.3;
    font-weight: 600;
  }
  
  .starter-product-card__title a {
    -webkit-line-clamp: 2;
  }
  
  .starter-product-card__price {
    font-size: 15px;
    font-weight: 700;
    color: var(--starter-text-primary);
  }
  
  /* Always show add to cart on mobile */
  .starter-product-card__actions {
    opacity: 1;
    transform: none;
    position: static;
    background: none;
    padding: 10px;
    padding-top: 6px;
  }
  
  .starter-product-card__add-to-cart {
    width: 100%;
    height: 38px;
    border-radius: 8px;
    background: var(--starter-primary);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
  }
  
  .starter-product-card__add-to-cart svg {
    width: 16px;
    height: 16px;
  }
  
  .starter-product-card__add-to-cart:hover {
    background: var(--starter-primary-hover);
    transform: none;
  }
  
  .starter-single-product-wrapper {
    padding: var(--starter-spacing-md);
  }
  
  .woocommerce div.product form.cart {
    flex-direction: column;
  }
  
  .woocommerce div.product form.cart .quantity {
    width: 100%;
  }
  
  .woocommerce div.product form.cart .quantity .qty {
    width: 100%;
  }
  
  /* Shortcode pages mobile optimization */
  .starter-page--raw .woocommerce,
  .starter-main--no-card .woocommerce {
    padding: 0 10px !important;
  }
  
  .starter-page--raw .woocommerce ul.products,
  .starter-main--no-card .woocommerce ul.products {
    gap: 10px !important;
  }
  
  /* Account for mobile sidebar toggle at top */
  body.starter-floating-sidebar-enabled .woocommerce ul.products {
    margin-top: 0;
  }
}

/* Very small screens - single column option */
@media (max-width: 360px) {
  .starter-products-grid,
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  
  .starter-product-card__content {
    padding: 6px;
  }
  
  .starter-product-card__title {
    font-size: 11px;
  }
  
  .starter-product-card__price {
    font-size: 13px;
  }
  
  .starter-product-card__actions {
    padding: 6px;
    padding-top: 0;
  }
  
  .starter-product-card__add-to-cart {
    height: 32px;
  }
}

/* ====================================
   CAROUSEL/SLIDER MOBILE FIX
   ==================================== */
/* Fix for product carousels/sliders on mobile */
@media (max-width: 768px) {
  /* ========================================
   * GLOBAL MOBILE PRODUCT GRID FIX
   * Prevents product overlapping on mobile
   * ======================================== */
  
  /* Default: All product lists become 2-column grid on mobile */
  .woocommerce ul.products,
  ul.products,
  .products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    overflow: visible !important;
  }
  
  /* Product items fill their grid cells properly */
  .woocommerce ul.products li.product,
  ul.products li.product,
  .products li.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    float: none !important;
    position: static !important;
  }
  
  /* Swiper/Slick/Generic Carousel Container */
  .swiper,
  .swiper-container,
  .slick-slider,
  .product-carousel,
  .products-carousel,
  [class*="carousel"],
  [class*="slider"]:not(.woocommerce-product-gallery__wrapper):not(input) {
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  /* Carousel Wrapper - prevent overflow */
  .swiper-wrapper,
  .slick-list,
  .carousel-wrapper,
  [class*="carousel-wrapper"],
  [class*="slider-wrapper"] {
    overflow: visible;
  }
  
  /* Individual slides - ensure proper sizing */
  .swiper-slide,
  .slick-slide,
  [class*="carousel-item"],
  [class*="slider-item"] {
    flex-shrink: 0 !important;
    width: auto !important;
    min-width: 45% !important;
    max-width: 50% !important;
  }
  
  /* Product cards inside carousels - fixed width */
  .swiper-slide .starter-product-card,
  .slick-slide .starter-product-card,
  [class*="carousel"] .starter-product-card,
  [class*="slider"]:not(input) .starter-product-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
  
  /* Product images in carousel - prevent overflow */
  .swiper-slide .starter-product-card__image,
  .slick-slide .starter-product-card__image,
  [class*="carousel"] .starter-product-card__image,
  [class*="slider"]:not(input) .starter-product-card__image {
    overflow: hidden !important;
  }
  
  .swiper-slide .starter-product-card__image img,
  .slick-slide .starter-product-card__image img,
  [class*="carousel"] .starter-product-card__image img,
  [class*="slider"]:not(input) .starter-product-card__image img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }
  
  /*
   * EXPLICIT CAROUSEL MODE
   * Only these specific classes get horizontal scroll
   * Add .starter-carousel or data-carousel="true" to enable
   */
  .starter-carousel ul.products,
  .products-carousel ul.products,
  .wc-block-carousel ul.products,
  [data-carousel="true"] ul.products {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px !important;
    padding-bottom: 10px !important;
  }
  
  .starter-carousel ul.products li.product,
  .products-carousel ul.products li.product,
  .wc-block-carousel ul.products li.product,
  [data-carousel="true"] ul.products li.product {
    flex: 0 0 160px !important;
    max-width: 160px !important;
    scroll-snap-align: start;
  }
  
  /*
   * RELATED PRODUCTS Section - Use Grid on Mobile
   * This fixes the overlapping issue on single product pages
   */
  section.related ul.products,
  section.upsells ul.products,
  section.cross-sells ul.products,
  .related.products ul.products,
  .upsells.products ul.products,
  .cross-sells ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
  }
  
  section.related ul.products li.product,
  section.upsells ul.products li.product,
  section.cross-sells ul.products li.product,
  .related.products ul.products li.product,
  .upsells.products ul.products li.product,
  .cross-sells ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
  
  /* Fix for WooCommerce blocks */
  .wc-block-grid,
  .wp-block-woocommerce-product-collection,
  .wp-block-woocommerce-featured-product,
  .wc-block-featured-products {
    overflow: hidden !important;
    max-width: 100vw !important;
  }
  
  .wc-block-grid__products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    overflow: visible !important;
  }
  
  .wc-block-grid__product {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* ========================================
   * HOMEPAGE/SHORTCODE SECTION FIX
   * Fix for Featured Products sections
   * ======================================== */
  
  /* Any section containing WooCommerce products */
  section .woocommerce ul.products,
  article .woocommerce ul.products,
  div[class*="featured"] ul.products,
  div[class*="product"] > ul.products,
  .elementor-widget ul.products,
  .wp-block-group ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    overflow: visible !important;
  }
  
  section .woocommerce ul.products li.product,
  article .woocommerce ul.products li.product,
  div[class*="featured"] ul.products li.product,
  div[class*="product"] > ul.products li.product,
  .elementor-widget ul.products li.product,
  .wp-block-group ul.products li.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    position: static !important;
  }
  
  /* ========================================
   * PRODUCT CARD FIX - Prevent Overflow
   * ======================================== */
  .starter-product-card,
  .woocommerce ul.products li.product > a,
  .woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    display: block !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  
  .starter-product-card__image,
  .woocommerce ul.products li.product img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
  }
}

/* ====================================
   iOS NATIVE APP MODE
   Mobile-only: Creates a native iOS app look and feel
   with bottom tab bar navigation and iOS-style UI
   ==================================== */
@media (max-width: 768px) {
  /* Only apply when iOS App Mode is enabled */
  body.starter-ios-app-mode {
    padding-bottom: 70px; /* Space for tab bar */
  }
  
  /* ========================================
     iOS APP TAB BAR - Fixed Bottom Navigation
     ======================================== */
  body.starter-ios-app-mode .starter-ios-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 99999;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
  }
  
  body.starter-ios-app-mode .starter-ios-tabbar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--starter-text-muted, #9ca3af);
    padding: 8px 16px;
    min-width: 60px;
    transition: all 0.2s ease;
    border-radius: 12px;
  }
  
  body.starter-ios-app-mode .starter-ios-tabbar__item:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.05);
  }
  
  body.starter-ios-app-mode .starter-ios-tabbar__item.active,
  body.starter-ios-app-mode .starter-ios-tabbar__item--active {
    color: var(--starter-primary, #2563eb);
  }
  
  body.starter-ios-app-mode .starter-ios-tabbar__icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
  }
  
  body.starter-ios-app-mode .starter-ios-tabbar__label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: -0.2px;
  }
  
  /* Cart badge on tab bar */
  body.starter-ios-app-mode .starter-ios-tabbar__badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--starter-error, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
  }
  
  body.starter-ios-app-mode .starter-ios-tabbar__item--cart {
    position: relative;
  }
  
  /* ========================================
     iOS-STYLE UI ELEMENTS
     ======================================== */
  
  /* iOS-style cards with larger touch targets */
  body.starter-ios-app-mode .starter-product-card {
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  }
  
  body.starter-ios-app-mode .starter-product-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* iOS-style buttons */
  body.starter-ios-app-mode button,
  body.starter-ios-app-mode .starter-btn,
  body.starter-ios-app-mode .woocommerce a.button,
  body.starter-ios-app-mode .woocommerce button.button {
    border-radius: 12px;
    min-height: 48px;
    font-weight: 600;
  }
  
  body.starter-ios-app-mode button:active,
  body.starter-ios-app-mode .starter-btn:active,
  body.starter-ios-app-mode .woocommerce a.button:active,
  body.starter-ios-app-mode .woocommerce button.button:active {
    transform: scale(0.97);
    opacity: 0.9;
  }
  
  /* iOS-style form inputs */
  body.starter-ios-app-mode input[type="text"],
  body.starter-ios-app-mode input[type="email"],
  body.starter-ios-app-mode input[type="tel"],
  body.starter-ios-app-mode input[type="password"],
  body.starter-ios-app-mode input[type="number"],
  body.starter-ios-app-mode textarea,
  body.starter-ios-app-mode select {
    border-radius: 12px;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    background: var(--starter-background, #f3f4f6);
    border: none;
  }
  
  body.starter-ios-app-mode input:focus,
  body.starter-ios-app-mode textarea:focus,
  body.starter-ios-app-mode select:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  }
  
  /* iOS-style page transitions */
  body.starter-ios-app-mode .starter-main {
    animation: ios-fade-in 0.3s ease;
  }
  
  @keyframes ios-fade-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* iOS-style section headers */
  body.starter-ios-app-mode h1,
  body.starter-ios-app-mode h2,
  body.starter-ios-app-mode h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
  }
  
  /* iOS-style WooCommerce messages */
  body.starter-ios-app-mode .woocommerce-message,
  body.starter-ios-app-mode .woocommerce-info,
  body.starter-ios-app-mode .woocommerce-error {
    border-radius: 14px;
    border-left: none;
    padding: 16px 20px;
    font-size: 14px;
  }
  
  /* Hide floating cart button when tab bar is visible */
  body.starter-ios-app-mode .starter-floating-cart {
    bottom: 85px;
  }
  
  /* Adjust floating sidebar tab position */
  body.starter-ios-app-mode .starter-floating-sidebar {
    bottom: auto;
  }
  
  /* iOS-style My Account navigation */
  body.starter-ios-app-mode .woocommerce-MyAccount-navigation ul li a {
    padding: 16px 20px;
    border-radius: 14px;
    font-size: 16px;
  }
  
  /* iOS-style cart totals */
  body.starter-ios-app-mode .cart_totals,
  body.starter-ios-app-mode #order_review {
    border-radius: 20px;
    padding: 24px;
  }
  
  /* iOS bounce effect for pull-to-refresh feel */
  body.starter-ios-app-mode {
    overscroll-behavior-y: contain;
  }
  
  /* Safe area padding for notched devices */
  body.starter-ios-app-mode .starter-header {
    padding-top: env(safe-area-inset-top, 0);
  }
  
  body.starter-ios-app-mode .starter-ios-tabbar {
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }
}

@media (max-width: 480px) {
  /* Smaller carousel items on very small screens - ONLY for actual carousels */
  .swiper-slide,
  .slick-slide,
  [class*="carousel-item"],
  [class*="slider-item"] {
    min-width: 42% !important;
    max-width: 48% !important;
  }
  
  /* Only apply to explicit carousel elements */
  .starter-carousel ul.products li.product,
  .products-carousel ul.products li.product,
  .wc-block-carousel ul.products li.product,
  [data-carousel="true"] ul.products li.product {
    flex: 0 0 140px !important;
    max-width: 140px !important;
  }
  
  .wc-block-grid__product {
    flex: 0 0 140px !important;
    max-width: 140px !important;
  }
  
  /* Related/upsells products remain grid on small screens */
  section.related ul.products,
  section.upsells ul.products,
  section.cross-sells ul.products {
    gap: 10px !important;
  }
}

@media (max-width: 360px) {
  /* Only apply to explicit carousel elements */
  .starter-carousel ul.products li.product,
  .products-carousel ul.products li.product,
  .wc-block-carousel ul.products li.product,
  [data-carousel="true"] ul.products li.product {
    flex: 0 0 130px !important;
    max-width: 130px !important;
  }
  
  .wc-block-grid__product {
    flex: 0 0 130px !important;
    max-width: 130px !important;
  }
  
  /* Related/upsells products remain grid on very small screens */
  section.related ul.products,
  section.upsells ul.products,
  section.cross-sells ul.products {
    gap: 8px !important;
  }
}