/* Product Card Component - Componente reutilizable para tarjetas de productos */

/* ========================================================================================
   BASE PRODUCT CARD STRUCTURE 
   ======================================================================================== */

/* Base Product Card */
.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid #e9ecef;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
}

/* Product Image */
.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background-color: #f8f9fa;
}

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

.product-card:hover .product-image img {
    transform: scale(1.02);
}

/* ========================================================================================
   PRODUCT BADGES AND LABELS
   ======================================================================================== */

/* Product Badges */
.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-badge.new {
    background: #28a745;
    color: white;
}

.product-badge.sale {
    background: #dc3545;
    color: white;
}

.product-badge.free,
.product-badge.free-badge {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    animation: pulse 2s infinite;
}

.product-badge.sale-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

/* ========================================================================================
   PRODUCT OVERLAY AND INTERACTIONS
   ======================================================================================== */

/* Product Overlay and Actions */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    color: #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.action-btn:hover {
    background: #333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn.active {
    background: #dc3545;
    color: white;
}

.action-btn:disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ========================================================================================
   SPECIFIC BUTTON TYPES
   ======================================================================================== */

/* Like button with counter */
.like-btn {
    position: relative;
}

.like-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.like-btn.active .like-count {
    background: #28a745;
}

/* Wishlist button states */
.wishlist-btn.active {
    background: #dc3545;
    color: white;
}

/* Quick view button effect */
.quickview-btn:hover {
    background-color: #6c757d;
    color: white;
}

/* Cart button variations for free products */
.cart-btn.free-product {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-weight: bold;
}

.cart-btn.free-product:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    transform: translateY(-2px);
}

/* Product actions without wishlist */
.product-actions.no-wishlist {
    justify-content: center;
    gap: 16px;
}

.product-actions.no-wishlist .action-btn {
    flex: 0 0 auto;
}

/* ========================================================================================
   PRODUCT DETAILS AND CONTENT
   ======================================================================================== */

/* Product Details */
.product-details {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    color: #999;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    flex: 1;
}

.product-title a {
    color: #333;
    text-decoration: none;
}

.product-title a:hover {
    color: var(--accent-color) !important;
}

/* Product Meta */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #333;
}

.original-price {
    font-size: 0.875rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
    font-weight: 400;
}

/* Free price styling */
.price-free {
    font-size: 1.2em;
    font-weight: bold;
    color: #28a745;
    text-transform: uppercase;
}

/* Currency styling improvements */
.price-currency {
    font-size: 0.8em;
    font-weight: normal;
    opacity: 0.8;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.product-rating i {
    color: #ffc107;
    font-size: 0.8rem;
}

.product-rating span {
    font-size: 0.75rem;
    color: #999;
}

/* ========================================================================================
   ANIMATIONS AND LOADING STATES
   ======================================================================================== */

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes thumbsUp {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(-10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Animation Applications */
.wishlist-btn.active i {
    animation: heartBeat 0.6s ease;
}

.like-btn.active i {
    animation: thumbsUp 0.5s ease;
}

/* Loading states */
.action-btn.loading {
    position: relative;
}

.action-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.action-btn.loading i {
    opacity: 0;
}

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

/* Tablet and Mobile */
@media (max-width: 768px) {
    .product-overlay {
        opacity: 1;
    }

    .product-actions {
        gap: 0.25rem;
        flex-wrap: wrap;
    }

    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 36px;
    }

    .like-count {
        font-size: 0.65rem;
        padding: 1px 4px;
        min-width: 16px;
    }

    .product-details {
        padding: 1rem;
    }

    .product-title {
        font-size: 0.95rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-actions.no-wishlist {
        gap: 12px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .product-badge {
        top: 10px;
        left: 10px;
        font-size: 0.7rem;
        padding: 0.3em 0.6em;
    }

    .product-details {
        padding: 0.875rem;
    }
}

/* Estilos para la página de productos - Basados en category.html */
.sidebar {
    padding: 0;
    margin-bottom: 2rem;
}

.widgets-container .widget-item {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.widgets-container .widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 0.5rem;
}

/* Product Categories Widget - Basado en category.html */
.product-categories-widget .category-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-categories-widget .category-item {
    border-bottom: 1px solid #f0f0f0;
}

.product-categories-widget .category-item:last-child {
    border-bottom: none;
}

.product-categories-widget .category-header {
    padding: 0.75rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-categories-widget .category-header:hover {
    background-color: #f8f9fa;
}

.product-categories-widget
    .category-header.collapsed
    .category-toggle
    i:first-child {
    display: inline;
}

.product-categories-widget
    .category-header.collapsed
    .category-toggle
    i:last-child {
    display: none;
}

.product-categories-widget
    .category-header:not(.collapsed)
    .category-toggle
    i:first-child {
    display: none;
}

.product-categories-widget
    .category-header:not(.collapsed)
    .category-toggle
    i:last-child {
    display: inline;
}

.product-categories-widget .category-toggle {
    font-size: 0.875rem;
    color: #6c757d;
    transition: color 0.3s ease;
}

.product-categories-widget .category-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    flex: 1;
}

.product-categories-widget .category-link:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.product-categories-widget .category-link.active {
    color: var(--accent-color);
    font-weight: 600;
}

.product-categories-widget .category-count {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 400;
    margin-left: 0.5rem;
}

.product-categories-widget .category-link.active .category-count {
    color: var(--accent-color);
}

.product-categories-widget .subcategory-list {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 0;
    margin: 0;
}

.product-categories-widget .subcategory-item {
    list-style: none;
}

.product-categories-widget .subcategory-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #555;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.product-categories-widget .subcategory-link:hover {
    background-color: #e9ecef;
    color: var(--accent-color);
    text-decoration: none;
}

.product-categories-widget .subcategory-link.active {
    background-color: var(--accent-color);
    color: white !important;
}

.product-categories-widget .subcategory-link.active .category-count {
    color: rgba(255, 255, 255, 0.8);
}

/* Pricing Range Widget - Basado en category.html */
.pricing-range-widget .price-range-container {
    padding: 0;
}

.pricing-range-widget .current-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.pricing-range-widget .range-slider {
    position: relative;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.pricing-range-widget .slider-track {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #e9ecef;
    border-radius: 3px;
}

.pricing-range-widget .slider-progress {
    position: absolute;
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    left: 0%;
    right: 0%;
}

.pricing-range-widget .min-range,
.pricing-range-widget .max-range {
    position: absolute;
    width: 100%;
    height: 6px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.pricing-range-widget .min-range::-webkit-slider-thumb,
.pricing-range-widget .max-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    border: 2px solid white;
    cursor: pointer;
    pointer-events: all;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pricing-range-widget .price-inputs .input-group-text {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    font-size: 0.875rem;
}

.pricing-range-widget .price-inputs .form-control {
    font-size: 0.875rem;
    border: 1px solid #ced4da;
}

.pricing-range-widget .filter-actions .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Free Products Filter Widget */
.free-products-widget .free-filter-content {
    padding: 0;
}

.free-products-widget .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.free-products-widget .form-check:hover {
    background-color: #f8f9fa;
}

.free-products-widget .form-check-input {
    margin: 0;
}

.free-products-widget .form-check-label {
    font-size: 0.95rem;
    cursor: pointer;
    margin: 0;
}

/* Currency Filter Widget */
.currency-filter-widget .currency-filter-content {
    padding: 0;
}

.currency-filter-widget .currency-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.currency-filter-widget .form-check {
    padding: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    border: 1px solid transparent;
}

.currency-filter-widget .form-check:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.currency-filter-widget .form-check-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    font-size: 0.95rem;
}

.currency-filter-widget .form-check-label i {
    color: #28a745;
}

.currency-filter-widget .form-check-input {
    margin: 0;
}

.currency-filter-widget .form-check-input:checked + .form-check-label {
    color: var(--accent-color);
    font-weight: 600;
}

.currency-filter-widget .form-check-input:checked + .form-check-label i {
    color: var(--accent-color);
}

.currency-filter-widget .form-check:has(.form-check-input:checked) {
    background-color: transparent !important;
    border-color: var(--accent-color);
}

.menu-nav .nav-link:hover,
.menu-nav .nav-link.active {
    background: #f8f9fa;
    color: color-mix(in srgb, var(--accent-color), #000 8%) !important;
    border-left: 4px solid color-mix(in srgb, var(--accent-color), #000 8%) !important;
}

/* Category Header Section - Basado en category.html */
.category-header .filter-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-header .filter-item {
    margin-bottom: 0;
}

.category-header .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.category-header .form-control,
.category-header .form-select {
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

.category-header .search-btn {
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: white;
    border-radius: 0 4px 4px 0;
}

.category-header .search-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.category-header .view-options {
    display: flex;
    gap: 0.25rem;
}

.category-header .view-btn {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    background: white;
    color: #666;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-header .view-btn.active,
.category-header .view-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.category-header .results-info {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}

/* Active Filters - Basado en category.html */
.active-filters {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.active-filter-label {
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
    margin-right: 1rem;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.filter-remove {
    background: none;
    border: none;
    color: white;
    padding: 0;
    margin-left: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.filter-remove:hover {
    color: #cce7ff;
}

.clear-all-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-all-btn:hover {
    background: #c82333;
}

/* Category Product List Section - Basado en category.html */
.category-product-list .row {
    margin: 0;
}

.category-product-list .row > div {
    padding: 0.75rem;
}

/* Responsive Grid - Asegurar mínimo 3 productos por fila en pantallas grandes */
@media (min-width: 1200px) {
    .category-product-list .col-xl-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .category-product-list .col-xl-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .category-product-list .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 767.98px) {
    .category-product-list .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Product Card Styles - Now using global styles from product-enhancements.css */

/* Animaciones y efectos especiales */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.1);
    }
    75% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes thumbsUp {
    0% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.2) rotate(-10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

/* Loading states already defined in product-enhancements.css */

/* No products found */
.no-products-found {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.no-products-content i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

.no-products-content h4 {
    margin-bottom: 1rem;
    color: #666;
    font-weight: 600;
}

.no-products-content p {
    color: #888;
    margin-bottom: 1.5rem;
}

/* Category Pagination Section - Basado en category.html */
.category-pagination nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.5rem;
    align-items: center;
}

.category-pagination nav ul li {
    list-style: none;
}

.category-pagination nav ul li a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    color: #666;
    text-decoration: none;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.3s ease;
    gap: 0.25rem;
}

.category-pagination nav ul li a:hover {
    background: #f8f9fa;
    color: #333;
    border-color: #dee2e6;
}

.category-pagination nav ul li a.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.category-pagination nav ul li.ellipsis {
    padding: 0.5rem 0.25rem;
    color: #999;
}

/* Page-specific responsive styles for filters and controls */
@media (max-width: 767.98px) {
    .products-controls {
        margin-top: 1rem;
    }

    .price-range-values {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-tags {
        flex-direction: column;
        align-items: flex-start;
    }
}

.products-grid .wishlist-btn.active i {
    animation: heartBeat 0.6s ease;
}

.products-grid .like-btn.active i {
    animation: thumbsUp 0.5s ease;
}
