/* --- Preparaciones CSS --- */

.preparaciones-main {
    background-color: #f8fafc;
    min-height: 80vh;
    padding-bottom: 60px;
}

.preparaciones-hero {
    background: linear-gradient(135deg, #003a7a 0%, #0056b3 100%);
    padding: 60px 5%;
    color: var(--white);
    text-align: center;
    margin-bottom: -40px; /* Overlap effect */
}

.preparaciones-hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.preparaciones-hero p {
    font-size: 16px;
    opacity: 0.9;
}

.preparaciones-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
    position: relative;
    z-index: 10;
}

/* Toggle Switch */
.toggle-section {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.toggle-wrapper {
    display: inline-flex;
    background: var(--white);
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    border: none;
    background: transparent;
    border-radius: 40px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn .toggle-icon {
    width: 24px;
    height: 24px;
    filter: grayscale(100%) opacity(0.6);
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    color: var(--primary-color);
}

.toggle-btn.active {
    background: var(--accent-color);
    color: var(--white);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.2);
}

.toggle-btn.active .toggle-icon {
    filter: brightness(0) invert(1);
}

/* Search Bar */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    fill: var(--text-light);
}

.search-input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border: 2px solid #eef2f5;
    border-radius: 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    color: var(--text-dark);
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0, 86, 179, 0.1);
}

/* Tables */
.table-wrapper {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.prep-table {
    width: 100%;
    border-collapse: collapse;
}

.prep-table th {
    background: #f1f5f9;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    padding: 18px 25px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.prep-table td {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-dark);
    font-size: 15px;
    line-height: 1.6;
    vertical-align: middle;
}

.prep-table tr:last-child td {
    border-bottom: none;
}

.prep-table tbody tr {
    transition: background-color 0.2s ease;
}

.prep-table tbody tr:hover {
    background-color: #f8fafc;
}

.prep-table td.cups-col {
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
}

.prep-table td.name-col {
    font-weight: 500;
}

.prep-table td.prep-col {
    color: #475569;
}

.prep-paragraph {
    margin-bottom: 12px;
}

.prep-paragraph:last-child {
    margin-bottom: 0;
}

.loading-state {
    text-align: center;
    padding: 40px !important;
    color: var(--text-light) !important;
    font-weight: 500;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.no-results svg {
    width: 48px;
    height: 48px;
    fill: currentColor;
    opacity: 0.5;
    margin-bottom: 15px;
}

.no-results p {
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Table */
@media (max-width: 768px) {
    .preparaciones-hero h1 { font-size: 28px; }
    
    .toggle-wrapper {
        flex-direction: column;
        width: 100%;
        background: transparent;
        box-shadow: none;
        gap: 10px;
    }
    
    .toggle-btn {
        width: 100%;
        justify-content: center;
        background: var(--white);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }

    /* CSS Hack para tablas responsivas (modo tarjeta) */
    .prep-table thead {
        display: none;
    }
    
    .prep-table tbody tr {
        display: block;
        padding: 20px;
        border-bottom: 8px solid #f8fafc;
    }
    
    .prep-table td {
        display: block;
        padding: 8px 0;
        border: none;
    }
    
    .prep-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        color: var(--primary-color);
        font-size: 12px;
        text-transform: uppercase;
        margin-bottom: 4px;
    }

.prep-table td.cups-col { font-size: 16px; }
    .prep-table td.name-col { font-size: 16px; margin-bottom: 5px; }
    .prep-table td.days-col { font-size: 14px; margin-bottom: 10px; color: #475569; }
}

/* Pagination Controls */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 2px solid #eef2f5;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.page-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--text-dark);
    transition: fill 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.15);
}

.page-btn:hover:not(:disabled) svg {
    fill: var(--white);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.page-info {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--white);
    padding: 10px 20px;
    border-radius: 12px;
    border: 2px solid #eef2f5;
}

.prep-table td.days-col {
    font-weight: 600;
    color: #e67e22; /* Naranja para resaltar los días */
}
