/**
 * Door Stop - Order a Door Online Feature
 * Scoped styles with kh-doorstop-* prefix to avoid conflicts
 */

/* ==============================================
   CTA SECTION - Homepage Button
   ============================================== */

.kh-doorstop-cta-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

/* Decorative background pattern */
.kh-doorstop-cta-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.kh-doorstop-cta-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.kh-doorstop-cta-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: kh-doorstop-fadeInUp 0.8s ease forwards;
}

.kh-doorstop-cta-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: kh-doorstop-fadeInUp 0.8s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.kh-doorstop-cta-subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    animation: kh-doorstop-fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.kh-doorstop-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 1.125rem 2.5rem;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    animation: kh-doorstop-fadeInUp 0.8s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect */
.kh-doorstop-cta-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.kh-doorstop-cta-button:hover::before {
    left: 100%;
}

.kh-doorstop-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.5);
}

.kh-doorstop-cta-button:active {
    transform: translateY(-1px);
}

.kh-doorstop-cta-button:focus {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 3px;
}

.kh-doorstop-cta-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.kh-doorstop-cta-subtext {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1rem;
    animation: kh-doorstop-fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

/* ==============================================
   MODAL - Fullscreen Overlay
   ============================================== */

.kh-doorstop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.kh-doorstop-modal-open {
    opacity: 1;
    visibility: visible;
}

.kh-doorstop-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: kh-doorstop-fadeIn 0.3s ease forwards;
}

.kh-doorstop-modal-container {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    animation: kh-doorstop-slideUp 0.4s ease forwards;
}

/* ==============================================
   MODAL HEADER
   ============================================== */

.kh-doorstop-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    z-index: 10;
}

.kh-doorstop-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.kh-doorstop-modal-title-icon {
    font-size: 1.5rem;
}

.kh-doorstop-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kh-doorstop-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.kh-doorstop-modal-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ==============================================
   MODAL CONTENT - iframe container
   ============================================== */

.kh-doorstop-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #f8fafc;
    position: relative;
}

.kh-doorstop-fallback {
    padding: 1rem 1.5rem;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
    text-align: center;
    font-size: 0.9rem;
    color: #92400e;
}

.kh-doorstop-fallback a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
}

.kh-doorstop-fallback a:hover {
    color: #1d4ed8;
}

.kh-doorstop-iframe-wrapper {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.kh-doorstop-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Loading spinner */
.kh-doorstop-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #64748b;
}

.kh-doorstop-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: kh-doorstop-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

/* ==============================================
   ANIMATIONS
   ============================================== */

@keyframes kh-doorstop-fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes kh-doorstop-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kh-doorstop-slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes kh-doorstop-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==============================================
   RESPONSIVE - Mobile & Tablet
   ============================================== */

@media (max-width: 768px) {
    .kh-doorstop-cta-title {
        font-size: 2rem;
    }

    .kh-doorstop-cta-subtitle {
        font-size: 1rem;
    }

    .kh-doorstop-cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .kh-doorstop-modal-header {
        padding: 1rem;
    }

    .kh-doorstop-modal-title {
        font-size: 1rem;
    }

    .kh-doorstop-modal-close {
        width: 36px;
        height: 36px;
    }

    .kh-doorstop-fallback {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .kh-doorstop-cta-section {
        padding: 3rem 0;
    }

    .kh-doorstop-cta-title {
        font-size: 1.75rem;
    }

    .kh-doorstop-cta-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .kh-doorstop-cta-button {
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }

    .kh-doorstop-modal-title {
        font-size: 0.9rem;
    }

    .kh-doorstop-modal-title-icon {
        font-size: 1.25rem;
    }
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */

/* Focus visible for keyboard navigation */
.kh-doorstop-cta-button:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 3px;
}

.kh-doorstop-modal-close:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .kh-doorstop-cta-badge,
    .kh-doorstop-cta-title,
    .kh-doorstop-cta-subtitle,
    .kh-doorstop-cta-button,
    .kh-doorstop-cta-subtext {
        animation: none;
        opacity: 1;
    }

    .kh-doorstop-modal-container {
        animation: none;
    }

    .kh-doorstop-modal-close:hover {
        transform: none;
    }

    .kh-doorstop-cta-button:hover {
        transform: none;
    }
}