/*
 * Cantik PWA — Install Prompt styles.
 * UI flotante en la parte inferior + modal iOS con instrucciones.
 */

.cs-pwa-install {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    z-index: 9999;
    pointer-events: none;
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1),
                opacity 200ms ease-out;
}

.cs-pwa-install[data-cs-visible="1"] {
    transform: translateY(0);
    opacity: 1;
}

.cs-pwa-install__card {
    pointer-events: auto;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 480px;
    margin: 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

@media (min-width: 600px) {
    .cs-pwa-install__card {
        flex-direction: row;
        align-items: center;
    }
}

.cs-pwa-install__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #A9165E;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-pwa-install__icon svg {
    width: 24px;
    height: 24px;
}

.cs-pwa-install__body {
    flex: 1;
    min-width: 0;
}

.cs-pwa-install__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
}

.cs-pwa-install__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #666;
}

.cs-pwa-install__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 599px) {
    .cs-pwa-install__actions {
        width: 100%;
    }
    .cs-pwa-install__actions .cs-pwa-install__btn {
        flex: 1;
    }
}

.cs-pwa-install__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 100ms ease, background 100ms ease;
}

.cs-pwa-install__btn:active {
    transform: scale(0.97);
}

.cs-pwa-install__btn--primary {
    background: #A9165E;
    color: #ffffff;
}

.cs-pwa-install__btn--ghost {
    background: transparent;
    color: #666;
    border: 1px solid #e0e0e0;
}

/* ============================================================================
   Modal de instrucciones iOS
   ============================================================================ */

.cs-pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: csPwaFadeIn 200ms ease-out;
}

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

.cs-pwa-ios-modal__card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px 24px 24px;
    max-width: 380px;
    width: 100%;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    animation: csPwaSlideUp 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cs-pwa-ios-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
}

.cs-pwa-ios-modal__close:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.cs-pwa-ios-modal__title {
    margin: 0 0 24px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: #1a1a1a;
}

.cs-pwa-ios-modal__steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cs-pwa-ios-modal__steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
}

.cs-pwa-ios-modal__step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #A9165E;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}
