/* =====================================================
   PRODUCTOS - ESTILOS
   ===================================================== */

/* Variables de color para compatibilidad */
:root {
    --white: #ffffff;
    --bg-color: #f8fafc;
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #0f172a;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #1e293b;
    --text-color: #475569;
    --text-light: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --transition: 0.3s ease;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 5;
}

.product-badge.new {
    background: var(--success-color);
}

.product-badge.offer {
    background: var(--warning-color);
}

.product-badge.premium {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
}

.product-wishlist {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-light);
    box-shadow: var(--shadow);
    transition: var(--transition);
    z-index: 5;
    opacity: 0;
}

.product-card:hover .product-wishlist {
    opacity: 1;
}

.product-wishlist:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.product-wishlist.active {
    color: var(--primary-color);
}

.product-wishlist.active i {
    font-weight: 900;
}

.product-image {
    position: relative;
    height: 200px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.product-image img {
    max-width: 85%;
    max-height: 85%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 30px 15px 15px;
    display: flex;
    gap: 10px;
    transform: translateY(100%);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    transform: translateY(0);
}

.product-actions button {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-add-cart {
    background: var(--primary-color);
    color: var(--white);
}

.btn-add-cart:hover {
    background: var(--primary-dark);
}

.btn-quick-view {
    background: var(--white);
    color: var(--secondary-color);
}

.btn-quick-view:hover {
    background: var(--secondary-color);
    color: var(--white);
}

.product-info {
    padding: 20px;
}

.product-category {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.product-name a {
    transition: var(--transition);
}

.product-name a:hover {
    color: var(--primary-color);
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.product-price .current {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-price .original {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-transfer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--success-color);
    font-weight: 500;
}

.product-transfer i {
    font-size: 1rem;
}

.product-stock {
    margin-top: 10px;
    font-size: 0.8rem;
}

.product-stock.in-stock {
    color: var(--success-color);
}

.product-stock.low-stock {
    color: var(--warning-color);
}

.product-stock.out-of-stock {
    color: var(--danger-color);
}

/* Product Card - Mobile Actions */
.product-mobile-actions {
    display: none;
    padding: 0 20px 20px;
}

.product-mobile-actions button {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: var(--transition);
}

.product-mobile-actions button:hover {
    background: var(--primary-dark);
}

/* Cuotas Info */
.product-cuotas {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.product-cuotas strong {
    color: var(--success-color);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-image {
        height: 150px;
        padding: 15px;
    }
    
    .product-image img {
        max-width: 90%;
        max-height: 90%;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-name {
        font-size: 0.85rem;
    }
    
    .product-price .current {
        font-size: 1.1rem;
    }
    
    .product-actions {
        display: none;
    }
    
    .product-mobile-actions {
        display: block;
    }
    
    .product-wishlist {
        opacity: 1;
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 130px;
        padding: 12px;
    }
    
    .product-image img {
        max-width: 95%;
        max-height: 95%;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-category {
        font-size: 0.65rem;
    }
    
    .product-name {
        font-size: 0.8rem;
        height: auto;
        -webkit-line-clamp: 2;
    }
    
    .product-price .current {
        font-size: 1rem;
    }
    
    .product-transfer {
        font-size: 0.75rem;
    }
    
    .product-mobile-actions {
        padding: 0 12px 12px;
    }
    
    .product-mobile-actions button {
        padding: 10px;
        font-size: 0.85rem;
    }
}

/* =====================================================
   MODAL PRODUCTO MEJORADO
   ===================================================== */
.modal-category {
    display: inline-block;
    background: var(--bg-color);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.modal-sku {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 5px;
}

.modal-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.modal-badge.premium {
    background: linear-gradient(135deg, #f39c12, #e74c3c);
}

.modal-badge.super {
    background: var(--success-color);
}

.modal-price-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    padding: 24px;
    border-radius: 16px;
    margin: 20px 0;
    border-left: 4px solid var(--success-color);
}

.modal-price .current {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--success-color);
    display: block;
    line-height: 1.2;
}

.modal-transfer-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    color: #047857;
}

.modal-transfer-price i {
    font-size: 1.3rem;
    color: var(--success-color);
}

.modal-transfer-price strong {
    font-size: 1.1rem;
}

.modal-transfer-price em {
    font-size: 0.85rem;
    opacity: 0.8;
}

.modal-cuotas {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    color: var(--text-color);
    font-size: 0.95rem;
    padding: 10px 0;
}

.modal-cuotas i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.modal-description {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
}

.modal-description h4,
.modal-specs h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-description h4 i,
.modal-specs h4 i {
    color: var(--primary-color);
}

.modal-description p {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.modal-specs {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.specs-table tr:last-child {
    border-bottom: none;
}

.specs-table td {
    padding: 10px 5px;
    font-size: 0.9rem;
}

.specs-table td:first-child {
    font-weight: 600;
    color: var(--text-dark);
    width: 40%;
}

.specs-table td:last-child {
    color: var(--text-color);
}

.modal-features {
    margin: 20px 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.modal-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-color);
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.modal-features li i {
    color: var(--success-color);
    font-size: 0.85rem;
}

.modal-qty {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.modal-qty span {
    font-weight: 500;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.qty-control button {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.qty-control button:hover {
    background: var(--primary-color);
    color: white;
}

.qty-control input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 1;
    min-width: 180px;
    padding: 16px 24px;
    font-size: 1rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.modal-actions .btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.modal-actions .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.modal-actions .btn-secondary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.modal-actions .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
}

.btn-lg {
    padding: 16px 32px !important;
}

.modal-share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.modal-share span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.modal-share button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-share button:nth-child(2) {
    background: #25D366;
    color: white;
}

.modal-share button:nth-child(3) {
    background: #1877F2;
    color: white;
}

.modal-share button:nth-child(4) {
    background: #1DA1F2;
    color: white;
}

.modal-share button:hover {
    transform: scale(1.1);
}

/* Modal responsive */
@media (max-width: 992px) {
    .modal-actions {
        flex-direction: row;
    }
    
    .modal-actions .btn {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .modal-features {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        min-width: 100%;
    }
    
    .modal-price .current {
        font-size: 1.75rem;
    }
    
    .modal-price-section {
        padding: 16px;
    }
}
