* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --magenta: #d946ef;
    --turquesa: #00d9ff;
    --mint: #10b981;
    --dark: #1c193e;
    --light: #f8f9fa;
    --white: #ffffff;
    --text: #333;
    --gray-light: #f3f4f6;
    --gray-border: #e5e7eb;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--white);
}

/* Header */
header {
    background: var(--white);
    color: var(--dark);
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 3px solid var(--turquesa);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 50px;
    width: auto;
}

.header-text h1 {
    font-size: 1.8em;
    margin-bottom: 2px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--dark);
}

.header-text p {
    font-size: 0.9em;
    color: var(--turquesa);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Hero Section */
.hero {
    background: var(--white);
    padding: 80px 20px 60px;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

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

.hero h2 {
    font-size: 3.2em;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -1px;
}

.hero h2 span {
    color: var(--turquesa);
}

.hero p {
    font-size: 1.25em;
    color: #666;
    max-width: 750px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.8;
}

/* Search & Filter */
.search-section {
    max-width: 1200px;
    margin: -40px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.search-container {
    background: var(--white);
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(217, 70, 239, 0.12);
    border: 2px solid var(--gray-light);
    animation: slideUp 0.8s ease-out;
}

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

.search-label {
    display: block;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: var(--dark);
    font-weight: 900;
}

.level-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.level-btn {
    padding: 14px 20px;
    border: 2px solid var(--gray-border);
    background: var(--white);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 700;
    transition: all 0.3s ease;
    color: var(--text);
}

.level-btn:hover {
    border-color: var(--turquesa);
    color: var(--turquesa);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.15);
}

.level-btn.active {
    background: var(--magenta);
    color: white;
    border-color: var(--magenta);
    box-shadow: 0 6px 16px rgba(217, 70, 239, 0.3);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* Section Title */
.section-title {
    font-size: 2.4em;
    color: var(--dark);
    margin-bottom: 50px;
    text-align: center;
    font-weight: 900;
    position: relative;
    padding-bottom: 25px;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 5px;
    background: var(--turquesa);
    border-radius: 3px;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 80px;
}

.resource-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cardAppear 0.6s ease-out forwards;
    opacity: 0;
    border: 2px solid transparent;
}

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

.resource-card:nth-child(1) { animation-delay: 0.1s; }
.resource-card:nth-child(2) { animation-delay: 0.15s; }
.resource-card:nth-child(3) { animation-delay: 0.2s; }
.resource-card:nth-child(4) { animation-delay: 0.25s; }
.resource-card:nth-child(5) { animation-delay: 0.3s; }
.resource-card:nth-child(6) { animation-delay: 0.35s; }

.resource-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 40px rgba(0, 217, 255, 0.2);
    border-color: var(--turquesa);
}

.resource-header {
    height: 200px;
    background: var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4.5em;
    position: relative;
    overflow: hidden;
}

.resource-content {
    padding: 28px;
}

.resource-level {
    display: inline-block;
    background: var(--magenta);
    color: white;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 800;
    margin-bottom: 15px;
}

.resource-title {
    font-size: 1.4em;
    color: var(--dark);
    margin-bottom: 12px;
    font-weight: 900;
    line-height: 1.3;
}

.resource-description {
    color: #666;
    font-size: 0.98em;
    margin-bottom: 20px;
    line-height: 1.7;
}

.resource-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 18px;
    border-top: 2px solid var(--gray-light);
}

.resource-price {
    font-size: 1.3em;
    font-weight: 900;
    color: var(--magenta);
}

.resource-price.free {
    color: var(--mint);
}

.resource-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 5px;
}

.star-btn:hover {
    transform: scale(1.3);
}

.star-btn.favorited {
    color: var(--turquesa);
}

.resource-btn {
    padding: 11px 22px;
    background: var(--magenta);
    color: white;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.resource-btn:hover {
    background: #c11fd4;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(217, 70, 239, 0.4);
}

/* Docente Creator Section */
.creator-section {
    background: var(--white);
    padding: 70px 50px;
    border-radius: 20px;
    margin-bottom: 80px;
    text-align: center;
    border: 3px solid var(--turquesa);
    box-shadow: 0 8px 32px rgba(0, 217, 255, 0.12);
}

.creator-icon {
    font-size: 4em;
    margin-bottom: 25px;
}

.creator-section h3 {
    font-size: 2.4em;
    color: var(--dark);
    margin-bottom: 18px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.creator-section p {
    font-size: 1.15em;
    color: #666;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
    font-weight: 400;
}

.creator-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    margin: 45px 0;
}

.benefit {
    background: var(--gray-light);
    padding: 30px;
    border-radius: 14px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.benefit:hover {
    border-color: var(--turquesa);
    transform: translateY(-5px);
}

.benefit-icon {
    font-size: 2.8em;
    margin-bottom: 15px;
}

.benefit-title {
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.benefit-text {
    font-size: 0.98em;
    color: #666;
    line-height: 1.6;
}

.creator-btn {
    padding: 18px 50px;
    background: var(--magenta);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.15em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(217, 70, 239, 0.3);
    letter-spacing: 0.5px;
}

.creator-btn:hover {
    background: #c11fd4;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(217, 70, 239, 0.4);
}

/* NekEdu Members Discount */
.members-discount {
    background: var(--magenta);
    color: white;
    padding: 70px 50px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(217, 70, 239, 0.3);
}

.members-discount::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.members-discount::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.members-discount-content {
    position: relative;
    z-index: 10;
}

.members-discount h3 {
    font-size: 2.6em;
    margin-bottom: 15px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.members-discount p {
    font-size: 1.2em;
    margin-bottom: 25px;
    opacity: 0.95;
    line-height: 1.8;
    font-weight: 400;
}

.discount-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 1.6em;
    font-weight: 900;
    margin: 25px 0;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.members-btn {
    padding: 18px 45px;
    background: white;
    color: var(--magenta);
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
}

.members-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

/* CTA Section */
.cta-final {
    text-align: center;
    padding: 70px 20px;
    background: var(--gray-light);
    border-radius: 20px;
    margin-bottom: 40px;
}

.cta-final h2 {
    font-size: 2.6em;
    color: var(--dark);
    margin-bottom: 18px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.cta-final h2 span {
    color: var(--turquesa);
}

.cta-final p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

.cta-buttons {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-primary {
    padding: 18px 50px;
    background: var(--magenta);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(217, 70, 239, 0.3);
    letter-spacing: 0.5px;
}

.cta-primary:hover {
    background: #c11fd4;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(217, 70, 239, 0.4);
}

.cta-secondary {
    padding: 18px 50px;
    background: white;
    color: var(--turquesa);
    border: 3px solid var(--turquesa);
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.cta-secondary:hover {
    background: var(--turquesa);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 217, 255, 0.3);
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 45px 20px;
}

footer p {
    margin: 12px 0;
    opacity: 0.9;
    font-weight: 500;
}

/* View Management */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Level Header */
.level-hero {
    background: linear-gradient(135deg, var(--dark) 0%, #2d2755 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.level-hero h1 {
    font-size: 2.8em;
    margin-bottom: 15px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.level-hero h1 span {
    color: var(--turquesa);
}

.level-hero p {
    font-size: 1.15em;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Breadcrumb */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.95em;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--turquesa);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb span {
    color: #999;
    margin: 0 5px;
}

.breadcrumb .current {
    color: var(--dark);
    font-weight: 900;
}

/* Filters Bar */
.level-filters {
    background: var(--gray-light);
    padding: 30px 20px;
    border-bottom: 2px solid var(--turquesa);
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
}

.filter-label {
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 15px;
    display: block;
    font-size: 1.05em;
}

.filter-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 18px;
    border: 2px solid var(--gray-border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    transition: all 0.3s ease;
    color: var(--text);
}

.filter-btn:hover {
    border-color: var(--turquesa);
    color: var(--turquesa);
}

.filter-btn.active {
    background: var(--magenta);
    color: white;
    border-color: var(--magenta);
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--turquesa);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 0.95em;
    margin-bottom: 30px;
}

.back-btn:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 16px rgba(0, 217, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .header-text h1 {
        font-size: 1.4em;
    }

    .hero h2 {
        font-size: 2.2em;
    }

    .hero p {
        font-size: 1.05em;
    }

    .section-title {
        font-size: 1.9em;
    }

    .resources-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .creator-section,
    .members-discount,
    .cta-final {
        padding: 40px 25px;
    }

    .creator-benefits {
        grid-template-columns: 1fr;
    }

    .members-discount h3 {
        font-size: 1.8em;
    }

    .cta-final h2 {
        font-size: 1.8em;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .cta-primary,
    .cta-secondary {
        width: 100%;
    }

    .level-hero h1 {
        font-size: 1.8em;
    }

    .level-hero p {
        font-size: 1em;
    }

    .breadcrumb {
        font-size: 0.85em;
    }

    .filter-options {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }
}

.cart-btn {
    background: linear-gradient(135deg, #ff4ecd, #00d9ff);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.cart-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.cart-count {
    background: white;
    color: #333;
    border-radius: 50%;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
}

/*carrito*/
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    width: 300px;
    animation: fadeIn 0.3s ease;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-around;
}

.modal-confirm {
    background: #00c853;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
}

.modal-cancel {
    background: #ff5252;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
}

@keyframes fadeIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.resource-type {
    font-size: 12px;
    background: rgba(255,255,255,0.15);
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    margin: 6px 0;
    color: #fff;
    font-weight: 500;
}
.toast {
    visibility: hidden;
    min-width: 300px;
    background-color: #e74c3c; /* Rojo Alerta (Flat Design) */
    color: #ffffff;
    text-align: center;
    border-radius: 12px;
    padding: 20px;
    position: fixed;
    z-index: 2000; /* Aseguramos que esté por encima de todo */
    left: 50%;
    top: 50%; /* Lo movemos al centro vertical */
    transform: translate(-50%, -50%) scale(0.7); /* Empezamos un poco más chico */
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 2px solid #c0392b; /* Un borde rojo más oscuro para dar profundidad */
    opacity: 0;
    transition: all 0.3s ease-in-out;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1); /* Efecto de rebote hacia el centro */
}