/* ========================================
   GLOBAL STYLES
======================================== */
:root {
    --primary-color: #c8a882;
    --primary-hover: #b8956b;
    --text-dark: #2c3e50;
    --text-medium: #6c757d;
    --text-light: #bdc3c7;
    --background-light: #f8f9fa;
    --background-white: #ffffff;
    --shadow-light: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-medium: 0 10px 30px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
    --border-radius: 15px;
}

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

/* ========================================
   PAGE HEADER - Centrado
======================================== */
.page-header {
    background: var(--background-white);
    padding: 3rem 0 3rem 0;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -1px;
}

.page-header .highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.header-subtitle {
    font-size: 1.1rem;
    color: var(--text-medium);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    font-weight: 400;
}

/* ========================================
   TEMPLATES SECTION
======================================== */
.templates {
    padding: 2rem 0 4rem 0;
    background: var(--background-white);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.templates-grid:last-child {
    margin-bottom: 0;
}

.template-description {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.no-templates {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 2rem 0;
}

.no-templates p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

.no-templates small {
    color: #999;
    font-size: 0.9rem;
}

/* ========================================
   TEMPLATE CARDS
======================================== */
.template-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    border: 2px solid rgba(200, 168, 130, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.template-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.template-image {
    position: relative;
    height: 400px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.template-image img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: var(--transition);
}

.template-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.template-card:hover .template-overlay {
    opacity: 1;
}

.template-card:hover .template-image img {
    transform: scale(1.01);
}

.template-info {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 1rem;
}

.template-info .btn-secondary,
.template-info a[class*="btn-secondary"] {
    margin-bottom: 0 !important;
    padding: 10px 15px;
}

.template-info .btn-comprar {
    margin-top: auto;  /* Empujar hacia abajo */
    padding: 12px 15px;
    font-weight: 600;
}

.template-info h3 {
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    color: var(--text-dark);
    font-weight: 500;
    line-height: 1.3;
}

/* ========================================
   TEMPLATE ACTIONS (BUTTONS)
======================================== */
.template-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-direction: column;
}

.template-actions .btn {
    width: 100%;
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.template-actions .btn i {
    font-size: 0.85rem;
}

.template-actions .btn:hover {
    transform: translateY(-2px);
}

.template-actions .btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
}

.template-actions .btn-primary:hover {
    background: var(--primary-hover);
}

.template-actions .btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-bottom: 10px;
}

.template-actions .btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.template-actions .btn-secondary.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #bdc3c7;
    color: #bdc3c7;
}

.template-actions .btn-secondary.disabled:hover {
    background: transparent;
    color: #bdc3c7;
}

.template-actions .btn.template-btn {
    padding: 10px 15px;
}

/* ========================================
   BOTONES EN TEMPLATE-INFO (MISMO TAMAÑO EXACTO)
======================================== */
.template-info .btn-secondary,
.template-info a.btn-secondary,
.template-info button.btn-secondary {
    width: 100%;
    padding: 12px 15px;
    font-size: 0.9rem;
    border-radius: 25px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-sizing: border-box;
    min-height: 44px;
}

.template-info .btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.template-info .btn-secondary.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #bdc3c7;
    color: #bdc3c7;
}

.template-info .btn-secondary.disabled:hover {
    background: transparent;
    color: #bdc3c7;
    transform: none;
}

.template-info .btn-comprar {
    width: 100%;
    padding: 12px 15px;
    font-size: 0.9rem;
    border-radius: 25px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0;
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    box-sizing: border-box;
    min-height: 44px;
}

/* Badge "Próximamente" */
.template-image {
    position: relative;
    overflow: hidden;
}

.badge-soon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Estilo para cards "Próximamente" */
.template-card.coming-soon {
    opacity: 0.85;
}

.template-card.coming-soon:hover {
    opacity: 1;
}

.template-card.coming-soon .template-image img {
    filter: grayscale(20%);
}


.template-info .btn-comprar:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.template-info .btn-comprar i,
.template-info .btn-secondary i {
    font-size: 0.85rem;
}

/* ========================================
   MODAL CUSTOM (SIN BOOTSTRAP)
======================================== */

/* Overlay del modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Contenedor del modal */
.modal-container {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
    opacity: 1;
}

/* Header del modal */
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, rgba(200, 168, 130, 0.08) 0%, rgba(200, 168, 130, 0.03) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(200, 168, 130, 0.1);
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* Body del modal */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Lista de planes */
.plans-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.plan-item:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(200, 168, 130, 0.15);
}

.plan-info {
    text-align: left;
    flex: 1;
}

.plan-info h6 {
    margin: 0 0 0.3rem 0;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plan-info p {
    margin: 0;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
}

.badge-small {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.plan-item:hover i {
    transform: translateX(5px);
}

/* Animaciones */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .modal-container {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .plan-item {
        padding: 1rem;
    }
    
    .plan-info h6 {
        font-size: 0.95rem;
    }
    
    .plan-info p {
        font-size: 1rem;
    }
    
    .badge-small {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Evitar scroll del body cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* ========================================
   CTA SECTION
======================================== */
.plantillas-cta {
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(200, 168, 130, 0.05), rgba(200, 168, 130, 0.1));
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 400;
}

.cta-content p {
    font-size: 1.1rem;
    color: var(--text-medium);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.cta-content .btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.cta-content .btn-primary {
    background: var(--primary-color);
    color: white;
}

.cta-content .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* ========================================
   ANIMATIONS
======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.template-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
}

.template-card.visible {
    opacity: 1;
    transform: scale(1);
    transition: var(--transition);
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 1024px) {
    .templates-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        text-align: center;
        padding: 2rem 0;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .header-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .templates {
        padding: 1rem 0 2rem 0;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .template-image {
        height: 300px;
    }
    
    .template-info {
        gap: 0.75rem;
    }
    
    .template-info h3 {
        font-size: 1.1rem;
    }
    
    .plan-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .btn-plan {
        min-height: 50px;
    }
    
    .plantillas-cta {
        padding: 40px 0;
    }
    
    .cta-content h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .page-header .highlight {
        display: block;
    }
    
    .templates {
        padding: 0.5rem 0 1.5rem 0;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .template-image {
        height: 250px;
    }
    
    .template-info {
        gap: 0.5rem;
    }

    .template-info .btn-comprar,
    .template-info .btn-secondary,
    .template-info a.btn-secondary,
    .template-info button.btn-secondary {
        padding: 10px 12px;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .template-info h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .plan-buttons {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
    
    .btn-plan {
        padding: 0.5rem !important;
        min-height: 60px;
        font-size: 0.75rem;
    }
    
    .plan-name {
        font-size: 0.7rem;
    }
    
    .plan-price {
        font-size: 0.85rem;
    }
    
    .no-templates {
        padding: 1.5rem;
    }
    
    .plantillas-cta {
        padding: 2rem 0;
    }
    
    .cta-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
}

/* ========================================
   MODAL CON ANIMACIÓN SUAVE
======================================== */

/* Overlay con fade-in */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Contenedor con animación de entrada */
.modal-container {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.7) translateY(50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Header del modal */
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, rgba(200, 168, 130, 0.08) 0%, rgba(200, 168, 130, 0.03) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(200, 168, 130, 0.1);
    color: var(--primary-color);
    transform: rotate(90deg);
}

/* Body del modal */
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* ========================================
   LISTA DE PLANES CON ANIMACIÓN
======================================== */

.plans-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Cada plan con animación de entrada escalonada */
.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
    animation: slideInLeft 0.5s ease forwards;
    opacity: 0;
}

/* Animación escalonada para cada plan */
.plan-item-0 {
    animation-delay: 0.1s;
}

.plan-item-1 {
    animation-delay: 0.2s;
}

.plan-item-2 {
    animation-delay: 0.3s;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.plan-item:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(200, 168, 130, 0.15);
}

.plan-info {
    text-align: left;
    flex: 1;
}

.plan-info h6 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plan-price {
    margin: 0.5rem 0;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1rem;
}

/* Ventajas del plan */
.plan-ventajas {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
    font-size: 0.8rem;
}

.plan-ventajas li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.plan-ventajas li i {
    color: var(--primary-color);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.plan-ventajas li.mas-ventajas {
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
    margin-top: 0.5rem;
}

.badge-small {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

.plan-item:hover i {
    transform: translateX(5px);
}

/* Animaciones */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .modal-container {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .plan-item {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .plan-info h6 {
        font-size: 0.95rem;
    }
    
    .plan-price {
        font-size: 0.95rem;
    }
    
    .plan-ventajas {
        font-size: 0.75rem;
    }
    
    .plan-item i {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .badge-small {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Evitar scroll del body cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}
