/* ================================
   Most Bought Carousel – Full CSS
   (NO hover scaling / enlarging)
================================ */

/* Container */
.mbc-carousel {
    position: relative;
    padding: 40px 50px;
    background: #fff;
    margin: 20px 0;
}

.mbc-carousel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* Inner track */
.mbc-inner {
    display: flex;
    gap: 20px;
    align-items: stretch;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mbc-inner::-webkit-scrollbar {
    display: none;
}

/* Card */
.mbc-item {
    position: relative;
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}



/* Link */
.mbc-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Image wrapper */
.mbc-image-wrap {
    position: relative;
    height: 220px;
    background: #fafafa;
    overflow: hidden;
}

/* Gradient overlay */
.mbc-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.05) 0%,
        rgba(118, 75, 162, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.mbc-item:hover .mbc-image-wrap::after {
    opacity: 1;
}

/* Image */
.mbc-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 0;
}

/* Info */
.mbc-info {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.mbc-name {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.4;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mbc-price {
    margin-top: auto;
    font-size: 18px;
    font-weight: 700;
    color: #002f8b;
}



.mbc-item:hover::after {
    opacity: 1;
}

/* Navigation buttons */
.mbc-prev,
.mbc-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: #fff;
    color: #002f8b;
    border: 2px solid #002f8b;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mbc-prev:hover,
.mbc-next:hover {
    background: #002f8b;
    color: #fff;
}

.mbc-prev { left: 10px; }
.mbc-next { right: 10px; }

/* Badges */
.mbc-discount,
.mbc-new {
    position: absolute;
    top: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    z-index: 4;
}

.mbc-discount {
    right: 12px;
    background: #ef4444;
}

.mbc-new {
    left: 12px;
    background: #10b981;
}

/* Add to cart (no motion) */
.mbc-item .add-to-cart {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mbc-item:hover .add-to-cart {
    opacity: 1;
}

/* Skeleton loading */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.mbc-loading .mbc-item {
    background: linear-gradient(
        to right,
        #f0f0f0 8%,
        #f8f8f8 18%,
        #f0f0f0 33%
    );
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
}

/* Responsive */
@media (max-width: 1200px) {
    .mbc-item { flex: 0 0 220px; }
    .mbc-image-wrap { height: 200px; }
}

@media (max-width: 992px) {
    .mbc-carousel { padding: 30px 45px; }
    .mbc-item { flex: 0 0 200px; }
    .mbc-image-wrap { height: 180px; }
}

@media (max-width: 768px) {
    .mbc-carousel { padding: 20px 40px; }
    .mbc-item { flex: 0 0 180px; }
    .mbc-image-wrap { height: 160px; }
    .mbc-name { font-size: 13px; }
    .mbc-price { font-size: 16px; }
}

@media (max-width: 576px) {
    .mbc-carousel { padding: 15px 35px; }
    .mbc-item { flex: 0 0 160px; }
    .mbc-image-wrap { height: 140px; }
}

/* Image wrapper takes almost full card height */
.mbc-image-wrap {
    position: relative;
    height: auto; /* auto so it grows with the image */
    flex-grow: 1; /* take remaining space above .mbc-info */
    background: #fafafa;
    overflow: hidden;
    padding: 0; /* remove extra padding */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image fills wrapper */
.mbc-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Card */
.mbc-item {
    position: relative;
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Info section stays at bottom */
.mbc-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Contenedor principal de botones flotantes */
.custom-actions-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    display: flex;
    gap: 10px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

/* Mostrar al hacer hover en el producto */
.mbc-item:hover .custom-actions-container {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Estilo individual de cada botón circular */
.custom-btn-item a, 
.custom-btn-item button {
    width: 42px;
    height: 42px;
    background-color: #ffffff !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    color: #333 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0;
    margin: 0;
}

/* Iconos dentro de los botones */
.custom-btn-item i {
    font-size: 18px !important;
    line-height: 1;
}

/* Efecto Hover en el botón */
.custom-btn-item a:hover, 
.custom-btn-item button:hover {
    background-color: #002f8b !important; /* Color azul de tu precio */
    color: #ffffff !important;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Asegurar que el botón del carrito no herede estilos de formulario molestos */
.custom-btn-item form {
    margin: 0;
    display: inline-block;
}

/* Ocultar cualquier texto que traiga LeoTheme por defecto */
.custom-btn-item span {
    display: none !important;
}


/* Container Layout */
.es-carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px; /* Space for arrows */
}

.es-carousel-inner {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    margin: 0 -15px;
}

/* Product Card Styling */
.es-item {
    width: 25%; /* 4 items per row */
    padding: 0 15px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
    margin-bottom: 30px;
}

/* Image Area */
.es-image-wrap {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
}

.es-image-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Hover Actions (The round icons) */
.es-actions {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0; /* Hidden by default */
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.es-item:hover .es-actions {
    opacity: 1; /* Show on hover */
    transform: translateY(0);
}

.es-actions a, 
.es-actions button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #002f8b;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.es-actions i {
    font-size: 18px;
}

/* Text Info */
.es-name {
    font-size: 14px;
    font-weight: 400;
    font-style: italic; /* Matches screenshot */
    margin: 10px 0;
    min-height: 40px;
}

.es-name a {
    color: #555;
    text-decoration: none;
}

.es-price {
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 15px;
}

/* The "VIEW PRODUCT" Button */
.btn-view-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #002f8b; /* Dark background */
    color: #fff;
    padding: 10px 20px;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-view-product:hover {
    background-color: #000;
    color: #fff;
}

/* Navigation Arrows */
.es-prev, .es-next {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.es-prev { left: 0; }
.es-next { right: 0; }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .es-item { width: 33.33%; }
}
@media (max-width: 768px) {
    .es-item { width: 50%; }
}
@media (max-width: 480px) {
    .es-item { width: 100%; }
}

/* Update 1: Hide the overflow so we only see 4 items at a time */
.es-carousel {
    overflow: hidden; 
    position: relative;
}

/* Update 2: Prevent wrapping and add smooth sliding animation */
.es-carousel-inner {
    display: flex;
    flex-wrap: nowrap; /* IMPORTANT: Changed from wrap to nowrap */
    transition: transform 0.5s ease-in-out; /* Smooth slide effect */
    width: 100%;
}

/* Update 3: Ensure items stay fixed width */
.es-item {
    flex: 0 0 25%; /* Fixes width to 25% (4 items) so they don't shrink */
    max-width: 25%;
    padding: 0 15px;
    box-sizing: border-box;
    text-align: center;
    position: relative;
}

/* Responsive updates for the flex-basis */
@media (max-width: 992px) {
    .es-item { flex: 0 0 33.33%; max-width: 33.33%; }
}
@media (max-width: 768px) {
    .es-item { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 480px) {
    .es-item { flex: 0 0 100%; max-width: 100%; }
}
/* Ensure FontAwesome takes priority for these icons */
.es-actions i, 
.es-prev i, 
.es-next i, 
.btn-view-product i {
    font-family: "Font Awesome 6 Free", "FontAwesome", sans-serif !important;
    font-weight: 900; /* Needed for solid icons in FA 6 */
    font-style: normal;
}

/* 1. Make all items in the row the same height */
.es-carousel-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch; /* This forces all children to match the height of the tallest one */
}

/* 2. Turn the article into a flex column */
.es-item {
    flex: 0 0 25%;
    max-width: 25%;
    display: flex;
    flex-direction: column; /* Stack image, name, price, button vertically */
    padding: 0 15px;
    box-sizing: border-box;
    text-align: center;
}

/* 3. The info area also needs to be a flex column to push the button down */
.es-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* This makes the info area take up all remaining vertical space */
}

/* 4. Push the button to the bottom */
.es-button-container {
    margin-top: auto; /* This is the "magic" line that pushes the button to the bottom */
    padding-top: 15px;
}

/* 5. Optional: Keep the name height consistent if you want the prices to line up too */
.es-name {
    min-height: 40px; /* Adjust based on your font size to fit ~2 lines */
    margin-bottom: 5px;
}

.es-image-wrap {
    height: 250px; /* Set a fixed height that fits your largest image */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.es-image-wrap img {
    max-height: 100%;
    width: auto;
}

.es-prev, .es-next {
    position: absolute;
    top: 50%; /* Changed from 40% to 50% for true center */
    transform: translateY(-50%) translateZ(0); /* translateZ(0) helps with blurriness */
    background-color: #002f8b; /* Your blue color */
    color: #ffffff; /* White icon */
    border: none; /* Removes the "blurry" default border */
    border-radius: 50%;
    width: 44px; /* Slightly larger is usually better for touch */
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* Adds depth without blur */
    outline: none; /* Removes focus ring on click */
    -webkit-font-smoothing: antialiased; /* Better icon rendering */
}

.es-prev:hover, .es-next:hover {
    background-color: #001f5c; /* Darker blue on hover */
    color: #ffffff;
}

.custom-carousel-module-title{
    text-align: center;
    font-weight: 600;
}

.module-mostboughtcarousel {
  margin-top: 75px;
  text-align: center;
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 1em;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #444;
}
.module-mostboughtcarousel span {
    padding: 0 20px 10px;
    border-bottom: 2px solid #444;
}