:root {
    --sp-primary: #601028;
    --sp-primary-soft: #7e1b3a;
    --sp-secondary: #a62346;
    --sp-accent: #0f766e;
    --sp-bg: #f6f3ef;
    --sp-surface: #ffffff;
    --sp-text: #1f2937;
    --sp-muted: #6b7280;
    --sp-border: #e8dee2;
    --sp-shadow-sm: 0 3px 14px rgba(76, 18, 38, 0.07);
    --sp-shadow-md: 0 12px 28px rgba(66, 20, 36, 0.12);
    --sp-radius-md: 14px;
    --sp-radius-lg: 20px;
    --sp-transition: all 0.22s ease;
}

* {
    font-family:
        "Montserrat",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    background: var(--sp-bg);
}

.sp-page {
    width: min(1320px, calc(100% - 2rem));
    margin: 1.75rem auto 2.5rem;
}

.sp-hero {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: var(--sp-primary) url("/images/fondo_rojo.png") center / cover
        no-repeat;
    border: none;
    padding: 1.1rem 2rem;
    color: #fff;
    box-shadow: none;
}

.sp-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.45rem;
}

.sp-hero-escudo {
    width: 52px;
    height: auto;
    opacity: 0.92;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.sp-hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sp-hero-title {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: clamp(1.2rem, 2.4vw, 1.6rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.sp-hero-subtitle {
    margin: 0.15rem auto 0;
    max-width: 740px;
    font-size: 0.88rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.sp-alert {
    margin: 1rem 0;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0.8rem 0.95rem;
    font-weight: 600;
}

.sp-alert-success {
    background: #ebf9f2;
    color: #0f5132;
    border-color: #9ddfba;
}

.sp-alert-warning {
    background: #fff7df;
    color: #8a6100;
    border-color: #f1dc99;
}

.sp-alert-danger {
    background: #fdf0f2;
    color: #7a2236;
    border-color: #efc2cf;
}

.sp-alert-info {
    background: #edf6ff;
    color: #1d4f8f;
    border-color: #bfd9fb;
}

.sp-shell {
    margin-top: 1.2rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 10px;
    box-shadow: var(--sp-shadow-sm);
    padding: 1.5rem;
}

.sp-toolbar {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
    margin-bottom: 0.95rem;
}

.sp-search {
    flex: 1;
}

.sp-search-label {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--sp-muted);
    font-weight: 700;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sp-search input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #dac9d0;
    background: #fff;
    min-height: 46px;
    padding: 0.7rem 0.85rem;
    color: var(--sp-text);
    font-size: 0.95rem;
    transition: var(--sp-transition);
}

.sp-search input:focus {
    outline: none;
    border-color: #b43c5f;
    box-shadow: 0 0 0 3px rgba(166, 35, 70, 0.18);
}

.sp-clear-btn {
    border: 1px solid #d4c3ca;
    background: #fff;
    color: #5f2435;
    border-radius: 12px;
    min-height: 46px;
    padding: 0.65rem 1rem;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: var(--sp-transition);
}

.sp-clear-btn:hover {
    border-color: #9b2f4e;
    background: #fff5f8;
}

.sp-view-toggle {
    display: flex;
    border: 1px solid #d4c3ca;
    border-radius: 12px;
    overflow: hidden;
    min-height: 46px;
    align-self: flex-end;
}

.sp-view-btn {
    border: none;
    background: #fff;
    color: #5f2435;
    padding: 0 0.75rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--sp-transition);
    cursor: pointer;
}

.sp-view-btn:not(:last-child) {
    border-right: 1px solid #d4c3ca;
}

.sp-view-btn:hover {
    background: #fff5f8;
}

.sp-view-btn.is-active {
    background: #8e2042;
    color: #fff;
}

.sp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.sp-card {
    border-radius: 6px;
    border: 1px solid #eadde1;
    background: #fff;
    box-shadow: 0 4px 15px rgba(83, 26, 44, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    transition: var(--sp-transition);
}

.sp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 22px rgba(77, 20, 37, 0.14);
    border-color: #d5a9b8;
}

.sp-card[hidden] {
    display: none !important;
}

.sp-card-image-wrapper {
    width: 100%;
    overflow: hidden;
    background: #f9f4f6;
}

.sp-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.sp-card:hover .sp-card-image {
    transform: scale(1.03);
}

.sp-card-body {
    padding: 1.1rem 1.15rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sp-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    color: var(--sp-text);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.01em;
}

.sp-card-description {
    margin: 0 0 0.7rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--sp-muted);
}

.sp-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.sp-btn {
    border-radius: 10px;
    padding: 0.5rem 0.74rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--sp-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sp-btn-primary {
    border: 1px solid #8a1f40;
    background: #8a1f40;
    color: #fff;
}

.sp-btn-primary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(166, 35, 70, 0.25);
}

.sp-grid.is-list-view {
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.sp-grid.is-list-view .sp-card {
    flex-direction: row;
    align-items: center;
}

.sp-grid.is-list-view .sp-card:hover {
    transform: none;
}

.sp-grid.is-list-view .sp-card-image-wrapper {
    width: 180px;
    flex-shrink: 0;
    align-self: stretch;
}

.sp-grid.is-list-view .sp-card-image {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
}

.sp-grid.is-list-view .sp-card:hover .sp-card-image {
    transform: none;
}

.sp-grid.is-list-view .sp-card-body {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
}

.sp-grid.is-list-view .sp-card-title {
    margin: 0;
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
}

.sp-grid.is-list-view .sp-card-description {
    display: none;
}

.sp-grid.is-list-view .sp-card-actions {
    margin-top: 0;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.sp-empty {
    border: 1px dashed #ddc8cf;
    border-radius: 14px;
    background: #fffafc;
    color: #744254;
    text-align: center;
    padding: 1.35rem 1rem;
}

.sp-empty i {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.sp-empty p {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 992px) {
    .sp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sp-page {
        width: calc(100% - 1rem);
        margin-top: 1rem;
    }

    .sp-hero {
        padding: 0.7rem 0.75rem;
    }

    .sp-hero-escudo {
        width: 36px;
    }

    .sp-hero-subtitle {
        font-size: 0.78rem;
    }

    .sp-shell {
        padding: 1rem;
    }

    .sp-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sp-clear-btn {
        width: 100%;
        justify-content: center;
    }

    .sp-view-toggle {
        align-self: stretch;
        justify-content: center;
    }

    .sp-view-btn {
        flex: 1;
    }

    .sp-grid {
        grid-template-columns: 1fr;
    }

    .sp-grid.is-list-view .sp-card {
        flex-direction: column;
        align-items: stretch;
    }

    .sp-grid.is-list-view .sp-card-image-wrapper {
        width: 100%;
    }

    .sp-grid.is-list-view .sp-card-image {
        aspect-ratio: 16 / 9;
    }

    .sp-grid.is-list-view .sp-card-body {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .sp-grid.is-list-view .sp-card-title {
        font-size: 1.05rem;
    }

    .sp-grid.is-list-view .sp-card-description {
        display: block;
    }

    .sp-grid.is-list-view .sp-card-actions {
        flex-wrap: wrap;
    }
}
