/* Basic Grid Layout - Responsive */
.rf-container.rf-layout-grid .rf-items {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 20px;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto;
}

/* Asegurar que el contenedor principal no tenga límites */
.rf-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin-bottom: 30px;
}

/* Eliminar margen del último contenedor */
.rf-container:last-child {
    margin-bottom: 0;
}

/* Breakpoints para mejor control responsive */
@media (max-width: 576px) {

    /* Móvil: 1 columna */
    .rf-container.rf-layout-grid .rf-items {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

@media (min-width: 577px) and (max-width: 768px) {

    /* Tablet pequeña: 2 columnas */
    .rf-container.rf-layout-grid .rf-items {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 769px) and (max-width: 992px) {

    /* Tablet grande: 3 columnas */
    .rf-container.rf-layout-grid .rf-items {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {

    /* Desktop pequeño: 4 columnas */
    .rf-container.rf-layout-grid .rf-items {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (min-width: 1201px) {

    /* Desktop grande: 5 columnas */
    .rf-container.rf-layout-grid .rf-items {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

.rf-item {
    width: 100% !important;
    max-width: none !important;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.rf-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rf-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

.rf-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.rf-content {
    padding: 15px;
}

.rf-item-title {
    margin: 0 0 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.rf-item-title a {
    text-decoration: none;
    color: inherit;
}

.rf-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.rf-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
}

/* List Layout */
.rf-container.rf-layout-list .rf-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.rf-container.rf-layout-list .rf-item {
    display: flex;
    flex-direction: row;
}


.rf-container.rf-layout-list .rf-image {
    width: 150px;
    height: auto;
    flex-shrink: 0;
}

/* Container responsive */
.rf-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 30px auto;
}

/* Responsive para items individuales */
.rf-item {
    width: 100%;
    max-width: 100%;
}

/* Ajustes responsive para layout de lista */
@media (max-width: 768px) {
    .rf-container.rf-layout-list .rf-item {
        flex-direction: column;
    }

    .rf-container.rf-layout-list .rf-image {
        width: 100%;
        height: 200px;
    }
}

/* Ajuste de imágenes en items individuales */
.rf-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ===================================================================
   DEALS SLIDER - Products on sale per category
   =================================================================== */

.rf-deals-section {
    width: 100% !important;
    margin: 30px 0 !important;
    padding: 0;
    box-sizing: border-box;
}

.rf-deals-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2c3e50;
    line-height: 1.3;
}

/* Slider wrapper (relative for nav arrows) */
.rf-deals-slider-wrapper {
    position: relative;
}

/* Horizontal scrollable slider */
.rf-deals-slider {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 5px 0 15px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.rf-deals-slider::-webkit-scrollbar {
    height: 6px;
}

.rf-deals-slider::-webkit-scrollbar-track {
    background: transparent;
}

.rf-deals-slider::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.rf-deals-slider::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Individual deal card */
.rf-deal-card {
    flex: 0 0 185px;
    scroll-snap-align: start;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.rf-deal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Discount badge */
.rf-deal-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 9px;
    border-radius: 5px;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.35);
}

/* Link reset */
.rf-deal-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

/* Product image */
.rf-deal-image {
    width: 100%;
    height: 170px;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.rf-deal-card:hover .rf-deal-image img {
    transform: scale(1.05);
}

/* No image placeholder */
.rf-deal-no-image {
    background: #eef1f4;
}

.rf-deal-placeholder {
    font-size: 3rem;
    opacity: 0.3;
}

/* Product info */
.rf-deal-info {
    padding: 12px;
}

.rf-deal-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 0 8px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.2em;
}

/* Prices */
.rf-deal-prices {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.rf-deal-original {
    text-decoration: line-through;
    color: #999;
    font-size: 0.82rem;
}

.rf-deal-final {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1rem;
}

/* Navigation arrows */
.rf-deals-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.rf-deals-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.rf-deals-slider-wrapper:hover .rf-deals-nav {
    opacity: 1;
}

.rf-deals-prev {
    left: -12px;
}

.rf-deals-next {
    right: -12px;
}

/* Responsive - Tablet */
@media (max-width: 992px) {
    .rf-deal-card {
        flex: 0 0 165px;
    }

    .rf-deal-image {
        height: 150px;
    }
}

/* Responsive - Mobile */
@media (max-width: 576px) {
    .rf-deals-title {
        font-size: 1.2rem;
    }

    .rf-deal-card {
        flex: 0 0 145px;
    }

    .rf-deal-image {
        height: 130px;
    }

    .rf-deal-info {
        padding: 8px;
    }

    .rf-deal-name {
        font-size: 0.8rem;
    }

    .rf-deal-original {
        font-size: 0.75rem;
    }

    .rf-deal-final {
        font-size: 0.9rem;
    }

    /* Hide arrows on mobile (swipe instead) */
    .rf-deals-nav {
        display: none !important;
    }
}