/**
 * TagControl Pro - Frontend Styles
 * @version 1.0.0
 */

/* ===== BADGES ===== */
.tc-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    margin: 4px 0;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.tc-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Badges en loop de productos */
.products .product .tc-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

/* ===== FILTROS AJAX ===== */
.tc-filter {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.tc-filter-controls {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.tc-filter-controls label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
    padding: 8px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tc-filter-controls label:hover {
    border-color: #2c3e50;
    background: #f0f0f0;
}

.tc-filter-controls label input[type="checkbox"] {
    margin-right: 5px;
}

.tc-filter-controls label input[type="checkbox"]:checked + span,
.tc-filter-controls label:has(input:checked) {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.tc-filter .tc-apply {
    padding: 10px 30px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tc-filter .tc-apply:hover {
    background: #1a252f;
    transform: scale(1.05);
}

.tc-results {
    margin-top: 20px;
}

.tc-results.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.tc-results.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c3e50;
    border-radius: 50%;
    animation: tc-spin 1s linear infinite;
    z-index: 100;
}

@keyframes tc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Grid de productos filtrados */
.tc-results .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.tc-results .product {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tc-results .product:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Paginación */
.tc-pagination {
    margin-top: 30px;
    text-align: center;
}

.tc-pagination button {
    margin: 0 5px;
    padding: 8px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tc-pagination button:hover {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.tc-pagination button.active {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.tc-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== PRODUCTOS RELACIONADOS ===== */
.tc-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.tc-related-grid .product {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tc-related-grid .product:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 768px) {
    .tc-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tc-filter-controls label {
        display: block;
        margin-right: 0;
    }
    
    .tc-results .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tc-related-grid {
        grid-template-columns: 1fr;
    }
    
    .tc-results .products {
        grid-template-columns: 1fr;
    }
}

/* ===== BANNERS CONDICIONALES ===== */
.tc-banner {
    padding: 20px;
    margin: 20px 0;
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tc-banner.success {
    background: #d4edda;
    border-color: #28a745;
}

.tc-banner.info {
    background: #d1ecf1;
    border-color: #17a2b8;
}

.tc-banner.danger {
    background: #f8d7da;
    border-color: #dc3545;
}

.tc-banner h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.tc-banner p {
    margin: 0;
    color: #333;
}
