/* ========== BOTONES PRINCIPALES ========== */
.cpr-box {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #e4405f;
}

.cpr-btn {
    display: inline-block;
    margin: 0 8px 8px 0;
    padding: 12px 18px;
    border-radius: 6px;
    background: #e0e0e0;
    color: #000;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cpr-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Colores por red social */
.cpr-fb { background: linear-gradient(135deg, #3b5998, #4c70ba); color: #fff; }
.cpr-ig { background: linear-gradient(135deg, #e4405f, #f56040); color: #fff; }
.cpr-wsp { background: linear-gradient(135deg, #25d366, #128c7e); color: #fff; }

.cpr-btn span {
    margin-right: 6px;
    font-size: 16px;
}

/* ========== MODAL DE INSTAGRAM STORY ========== */
#cpr-story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

/* ========== CONTENEDOR PRINCIPAL DE LA STORY ========== */
.cpr-story-wrap {
    width: 360px;
    height: 640px;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

/* ========== IMAGEN PRINCIPAL DEL PRODUCTO ========== */
#cpr-story-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 1;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    max-width: none;
    max-height: none;
}

/* ========== LOGO EN DIFERENTES POSICIONES ========== */
.cpr-story-logo {
    position: absolute;
    z-index: 10;
    width: 60px;
    height: 60px;
}

.cpr-story-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.cpr-logo-top-left { top: 20px; left: 20px; }
.cpr-logo-top-right { top: 20px; right: 20px; }
.cpr-logo-bottom-left { bottom: 120px; left: 20px; }
.cpr-logo-bottom-right { bottom: 120px; right: 20px; }

/* ========== INFORMACIÓN DEL PRODUCTO ========== */
.cpr-story-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    text-align: center;
    z-index: 5;
}

.cpr-story-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    line-height: 1.2;
}

.cpr-story-price {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.cpr-story-cta {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== PLANTILLAS DE DISEÑO ========== */

/* Plantilla Moderna (por defecto) */
.cpr-template-modern .cpr-story-info {
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

/* Plantilla Minimalista */
.cpr-template-minimal .cpr-story-info {
    background: rgba(255,255,255,0.95);
    color: #333;
}

.cpr-template-minimal .cpr-story-title,
.cpr-template-minimal .cpr-story-price,
.cpr-template-minimal .cpr-story-cta {
    color: #333;
    text-shadow: none;
}

/* Plantilla con Gradiente */
.cpr-template-gradient {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
}

.cpr-template-gradient #cpr-story-img {
    height: 70%;
    top: 15%;
    border-radius: 12px;
    margin: 0 20px;
    width: calc(100% - 40px);
    object-fit: cover;
    object-position: center center;
}

.cpr-template-gradient .cpr-story-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(102,126,234,0.1) 0%, 
        rgba(118,75,162,0.1) 100%);
    pointer-events: none;
    z-index: 2;
}

/* ========== CONTROLES DEL MODAL ========== */
.cpr-modal-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.cpr-btn-primary {
    background: linear-gradient(135deg, #e4405f, #f56040);
    color: #fff;
    font-size: 16px;
    padding: 15px 25px;
}

.cpr-btn-secondary {
    background: #6c757d;
    color: #fff;
    font-size: 16px;
    padding: 15px 25px;
}

.cpr-hint {
    color: #fff;
    margin: 0;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
    max-width: 360px;
}

.cpr-hint span {
    margin-right: 8px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
    .cpr-story-wrap {
        width: 300px;
        height: 533px;
    }
    
    .cpr-story-title {
        font-size: 20px;
    }
    
    .cpr-story-price {
        font-size: 24px;
    }
    
    .cpr-story-logo {
        width: 50px;
        height: 50px;
    }
    
    .cpr-modal-controls {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    .cpr-btn-primary,
    .cpr-btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* ========== ANIMACIONES ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#cpr-story-modal[style*="flex"] .cpr-story-wrap {
    animation: slideIn 0.3s ease-out;
}

/* ========== MEJORAS DE ACCESIBILIDAD ========== */
.cpr-btn:focus {
    outline: 3px solid rgba(228, 64, 95, 0.5);
    outline-offset: 2px;
}

/* ========== ESTILOS PARA EL ADMIN ========== */
.cpr-admin-preview {
    border: 2px solid #e4405f;
    padding: 10px;
    border-radius: 8px;
    background: #f9f9f9;
}