/* ========================================
   PRODUCTS MODULE CSS
   Estilos específicos para Productos
   ======================================== */

/* ==========================================
   PRODUCTS LAYOUT PRINCIPAL
   ========================================== */

.products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.products-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--primary);
}

.products-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.products-subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 300;
}

/* ==========================================
   PRODUCTS GRID LAYOUT
   ========================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.product-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

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

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

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-item:hover .product-overlay {
    opacity: 1;
}

.product-actions {
    display: flex;
    gap: 1rem;
}

.product-action-btn {
    width: 45px;
    height: 45px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    border: 2px solid transparent;
}

.product-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
    border-color: white;
}

.product-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge.sold {
    background: #dc3545;
}

.product-badge.featured {
    background: #28a745;
}

.product-content {
    padding: 2rem;
}

.product-category {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.product-title:hover {
    color: var(--primary);
}

.product-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.product-price .currency {
    font-size: 1rem;
    vertical-align: top;
}

.product-price .old-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.product-tag {
    background: #f8f9fa;
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

.product-actions-bottom {
    display: flex;
    gap: 0.5rem;
}

.product-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.product-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.product-btn.primary {
    background: var(--primary);
    color: white;
}

.product-btn.primary:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* ==========================================
   PRODUCT SINGLE VIEW
   ========================================== */

.product-single {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.product-single-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    position: relative;
}

.product-single-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.product-single-header {
    display: flex;
    gap: 3rem;
    padding: 3rem;
    align-items: flex-start;
}

.product-single-gallery {
    flex-shrink: 0;
    width: 400px;
}

.product-single-main-image {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 2px solid #eee;
}

.product-single-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-single-thumbnails {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}

.product-single-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}

.product-single-thumbnail.active {
    border-color: var(--primary);
}

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

.product-single-info {
    flex: 1;
}

.product-single-category {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-single-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.product-single-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.product-single-price .currency {
    font-size: 1.2rem;
    vertical-align: top;
}

.product-single-price .old-price {
    font-size: 1.2rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.product-single-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 2rem;
}

.product-single-features {
    margin-bottom: 2rem;
}

.product-single-features h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.product-single-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-single-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-single-features li:last-child {
    border-bottom: none;
}

.product-single-features li::before {
    content: '✓';
    color: var(--primary);
    font-weight: bold;
    font-size: 1.2rem;
}

.product-single-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.product-single-btn {
    padding: 1rem 2rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.product-single-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.product-single-btn.primary {
    background: var(--primary);
    color: white;
}

.product-single-btn.primary:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}

.product-single-body {
    padding: 0 3rem 3rem;
}

.product-single-tabs {
    margin-bottom: 2rem;
}

.product-single-tab-nav {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 2rem;
}

.product-single-tab-btn {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.product-single-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.product-single-tab-content {
    display: none;
}

.product-single-tab-content.active {
    display: block;
}

/* ==========================================
   PRODUCT FILTERS
   ========================================== */

.products-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.product-filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.product-filter-btn:hover,
.product-filter-btn.active {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ==========================================
   PRODUCT SEARCH
   ========================================== */

.products-search {
    margin-bottom: 3rem;
    text-align: center;
}

.products-search-form {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.products-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.products-search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.products-search-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ==========================================
   PRODUCT CATEGORIES
   ========================================== */

.products-categories {
    margin-bottom: 3rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-item {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.category-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.category-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.category-count {
    font-size: 0.9rem;
    color: #666;
}

/* ==========================================
   PRODUCT SIDEBAR
   ========================================== */

.products-sidebar {
    padding-left: 2rem;
}

.products-sidebar .sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.products-sidebar .widget-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary);
    position: relative;
}

.products-sidebar .widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--secondary);
}

/* Widget de categorías */
.products-categories-widget .category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.products-categories-widget .category-item {
    margin-bottom: 0.5rem;
}

.products-categories-widget .category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.products-categories-widget .category-link:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.products-categories-widget .category-count {
    background: var(--secondary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.products-categories-widget .category-link:hover .category-count {
    background: white;
    color: var(--primary);
}

/* Widget de productos recientes */
.recent-products .recent-product {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.recent-products .recent-product:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.recent-products .recent-product-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-products .recent-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-products .recent-product-content {
    flex: 1;
}

.recent-products .recent-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.recent-products .recent-product-title:hover {
    color: var(--primary);
}

.recent-products .recent-product-price {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 991px) {
    .products-sidebar {
        padding-left: 0;
        margin-top: 3rem;
    }
    
    .product-single-header {
        flex-direction: column;
        gap: 2rem;
    }
    
    .product-single-gallery {
        width: 100%;
    }
    
    .product-single-main-image {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .product-content {
        padding: 1.5rem;
    }
    
    .product-single-header {
        padding: 2rem;
    }
    
    .product-single-body {
        padding: 0 2rem 2rem;
    }
    
    .product-single-title {
        font-size: 2rem;
    }
    
    .product-single-price {
        font-size: 1.5rem;
    }
    
    .products-filters {
        gap: 0.5rem;
    }
    
    .product-filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .products-container,
    .product-single {
        padding: 1rem 0.5rem;
    }
    
    .products-title {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-content {
        padding: 1.25rem;
    }
    
    .product-single-header {
        padding: 1.5rem;
    }
    
    .product-single-body {
        padding: 0 1.5rem 1.5rem;
    }
    
    .product-single-main-image {
        height: 250px;
    }
    
    .product-single-title {
        font-size: 1.8rem;
    }
    
    .product-single-price {
        font-size: 1.3rem;
    }
    
    .product-single-actions {
        flex-direction: column;
    }
    
    .product-single-btn {
        flex: none;
    }
    
    .products-sidebar .sidebar-widget {
        padding: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .product-single-tab-nav {
        flex-direction: column;
    }
    
    .product-single-tab-btn {
        text-align: left;
        border-bottom: 1px solid #eee;
        border-right: none;
    }
    
    .product-single-tab-btn.active {
        border-bottom-color: #eee;
        border-left: 3px solid var(--primary);
    }
}

/* ==========================================
   PRODUCTS CATALOGUE SPECIFIC STYLES
   ========================================== */

/* Estilos para igualar el tamaño de las cards de productos */
.product {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-thumb-info {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-thumb-info-image {
    height: 300px;
    overflow: hidden;
    position: relative;
}

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

.product-thumb-info-image:hover img {
    transform: scale(1.05);
}

.product-thumb-info-image .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Asegurar que el contenido de la card se distribuya uniformemente */
.product .d-flex {
    flex-grow: 1;
    flex-direction: column;
    justify-content: space-between;
}

/* Estilos simplificados para los badges de categorías */
.nav-link .badge {
    font-size: 0.75rem;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0.25em 0.4em;
    border-radius: 10px;
}

/* Mejorar la apariencia de los carousels */
.carousel-control-prev,
.carousel-control-next {
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.carousel-control-prev {
    left: 10px;
}

.carousel-control-next {
    right: 10px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 15px;
    height: 15px;
}

/* Estilos para paginación simple */
.pagination-simple {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.pagination-simple .btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-simple .btn-outline-primary {
    color: #223A70;
    border-color: #223A70;
    background-color: transparent;
}

.pagination-simple .btn-outline-primary:hover {
    color: #fff;
    background-color: #223A70;
    border-color: #223A70;
}

.pagination-simple .btn-outline-secondary {
    color: #6c757d;
    border-color: #C8A897;
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.pagination-simple span {
    color: #333;
    font-weight: 500;
}

/* ELIMINAR COMPLETAMENTE TODAS LAS FLECHAS DE PAGINACIÓN */
.pagination .page-item:first-child,
.pagination .page-item:last-child {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Eliminar cualquier pseudo-elemento que pueda generar flechas */
.pagination .page-link::before,
.pagination .page-link::after {
    display: none !important;
    content: none !important;
}

/* Asegurar que no aparezcan flechas en ningún lado */
[class*="carousel-control"],
[class*="carousel-indicator"],
.pagination [class*="prev"],
.pagination [class*="next"] {
    display: none !important;
    visibility: hidden !important;
}
