/* VELLSTORE CATEGORY MOBILE TWO-COLUMN GRID V6 20260927 */
@media (max-width: 767.98px) {
  /* Strict 2-column grid scoped only to category products without touching containers or outer margins */
  body#category #js-product-list .products,
  body#category .products.row,
  body#category .products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body#category #js-product-list .products > .product,
  body#category #js-product-list .products > .js-product,
  body#category .products.row > .product,
  body#category .products.row > .js-product,
  body#category .products > .product,
  body#category .products > .js-product {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
  }

  body#category .products .product-miniature {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
    background: #fff !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .10) !important;
    position: relative !important;
    border: 1px solid #f0eaeb !important;
  }

  body#category .products .product-miniature .thumbnail-container {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    position: relative !important;
  }

  body#category .products .product-miniature .thumbnail-top {
    position: relative !important;
    overflow: hidden !important;
    background: #fff !important;
    width: 100% !important;
  }

  /* PRESERVE SHINE & ZOOM: Keep .product-thumbnail structure intact */
  body#category .products .product-miniature .product-thumbnail {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    height: 155px !important;
    background: #fff !important;
    text-align: center !important;
    margin: 0 auto !important;
  }

  body#category .products .product-miniature .product-thumbnail img {
    max-width: 100% !important;
    max-height: 145px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto !important;
    display: block !important;
  }

  /* RED CIRCLE DISCOUNT BADGE: Matching carousel style exactly */
  body#category .products .product-miniature .product-flags {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
    pointer-events: none !important;
  }

  body#category .products .product-miniature .product-flags li.product-flag {
    position: relative !important;
    top: auto !important;
    left: auto !important;
  }

  body#category .products .product-miniature .product-flags li.product-flag.discount,
  body#category .products .product-miniature .product-flags li.product-flag.discount-percentage,
  body#category .products .product-miniature .product-flags li.product-flag.discount-product,
  body#category .products .product-miniature .product-flags li.product-flag.discount-amount {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
    background: rgb(200, 16, 46) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 3px 8px rgba(200, 16, 46, 0.32) !important;
    letter-spacing: -0.02em !important;
    flex-shrink: 0 !important;
  }

  /* NUEVO: Blue badge lowered, slim height (15px), text centered */
  body#category .products .product-miniature .product-flags li.product-flag.new {
    border-radius: 4px !important;
    background: #0087a8 !important;
    color: #ffffff !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    height: 15px !important;
    min-height: 15px !important;
    padding: 0 5px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 15px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18) !important;
    margin-top: 5px !important;
    width: auto !important;
    max-width: fit-content !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }

  body#category .products .product-miniature .wishlist-button-add {
    top: 8px !important;
    right: 8px !important;
    width: 34px !important;
    height: 34px !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10) !important;
  }

  body#category .products .product-miniature .product-description {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 6px 8px 10px !important;
    background: #fff !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  body#category .products .product-miniature .product-title {
    margin: 0 0 4px !important;
    text-align: center !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    min-height: 2.4em !important;
  }

  body#category .products .product-miniature .product-title a {
    font-size: 0.80rem !important;
    line-height: 1.22 !important;
    color: #232323 !important;
    font-weight: 700 !important;
  }

  body#category .products .product-miniature .product-price-and-shipping {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 4px !important;
    margin: 2px 0 2px !important;
  }

  body#category .products .product-miniature .product-price-and-shipping .price {
    font-size: 0.92rem !important;
    font-weight: 850 !important;
    color: rgb(200, 16, 46) !important;
  }

  body#category .products .product-miniature .product-price-and-shipping .regular-price {
    font-size: 0.74rem !important;
    color: #888 !important;
    text-decoration: line-through !important;
  }

  body#category .products .product-miniature .product-price-and-shipping .discount-percentage {
    display: none !important;
  }

  body#category .products .product-miniature .vell-advance-price {
    margin: 2px 0 6px !important;
    padding: 3px 4px !important;
    border-radius: 8px !important;
    font-size: 0.70rem !important;
    text-align: center !important;
    line-height: 1.2 !important;
  }

  /* RESPONSIVE AÑADIR AL CARRITO BUTTON: Carousel style with perfect fit */
  body#category .products .product-miniature .vell-list-add,
  body#category .products .product-miniature form.add-to-cart-or-refresh {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  body#category .products .product-miniature .add-to-cart,
  body#category .products .product-miniature button.add-to-cart,
  body#category .products .product-miniature button.btn.btn-primary.add-to-cart {
    width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    border: 1px solid rgb(200, 16, 46) !important;
    background: #ffffff !important;
    color: rgb(200, 16, 46) !important;
    font-size: clamp(0.60rem, 2.3vw, 0.72rem) !important;
    font-weight: 700 !important;
    padding: 2px 4px !important;
    border-radius: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.01em !important;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
  }

  body#category .products .product-miniature .add-to-cart:hover,
  body#category .products .product-miniature .add-to-cart:active {
    background: rgb(200, 16, 46) !important;
    color: #ffffff !important;
  }

  body#category .products .product-miniature .add-to-cart:hover .material-icons,
  body#category .products .product-miniature .add-to-cart:active .material-icons {
    color: #ffffff !important;
  }

  body#category .products .product-miniature .add-to-cart .material-icons,
  body#category .products .product-miniature .add-to-cart i.material-icons,
  body#category .products .product-miniature .add-to-cart span.material-icons {
    font-size: 14px !important;
    line-height: 1 !important;
    color: rgb(200, 16, 46) !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
  }

  body#category .products .product-miniature .add-to-cart span:not(.material-icons) {
    font-size: inherit !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: inherit !important;
  }
}

/* Strictly enforce 2 columns and proportional scaling on sub-390px screens */
@media (max-width: 390px) {
  body#category #js-product-list .products,
  body#category .products.row,
  body#category .products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  body#category #js-product-list .products > .product,
  body#category #js-product-list .products > .js-product,
  body#category .products.row > .product,
  body#category .products.row > .js-product,
  body#category .products > .product,
  body#category .products > .js-product {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body#category .products .product-miniature .product-thumbnail {
    height: 140px !important;
  }

  body#category .products .product-miniature .product-thumbnail img {
    max-height: 130px !important;
    height: auto !important;
  }

  body#category .products .product-miniature .product-flags li.product-flag.discount,
  body#category .products .product-miniature .product-flags li.product-flag.discount-percentage,
  body#category .products .product-miniature .product-flags li.product-flag.discount-product,
  body#category .products .product-miniature .product-flags li.product-flag.discount-amount {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    font-size: 10.5px !important;
  }

  body#category .products .product-miniature .product-title a {
    font-size: 0.75rem !important;
  }

  body#category .products .product-miniature .product-price-and-shipping .price {
    font-size: 0.86rem !important;
  }

  body#category .products .product-miniature .product-price-and-shipping .regular-price {
    font-size: 0.70rem !important;
  }

  body#category .products .product-miniature .vell-advance-price {
    font-size: 0.66rem !important;
    padding: 2px 3px !important;
  }

  body#category .products .product-miniature .add-to-cart {
    height: 30px !important;
    min-height: 30px !important;
    font-size: 0.60rem !important;
    padding: 2px 2px !important;
  }

  body#category .products .product-miniature .add-to-cart .material-icons {
    font-size: 13px !important;
  }
}
