/**
 * Ghost Slicer Landing Page Styles 🚀
 * 
 * مسار الملف: public/features/landing/landing.css
 * الوظيفة: تنسيق صفحات الهبوط (Zero-Gap + Mobile Sticky Button)
 */

/* ============================================
   1. RESET & BASE
   ============================================ */

.dz-landing-body {
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide WP admin bar if logged in */
.dz-landing-body #wpadminbar {
    display: none !important;
}

.dz-landing-body.admin-bar {
    margin-top: 0 !important;
}

/* ============================================
   2. LAYOUT WRAPPER
   ============================================ */

.dz-landing-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
}

/* Desktop: Center content for better readability */
@media (min-width: 768px) {
    .dz-landing-wrapper {
        max-width: 600px;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.08);
    }
}

/* ============================================
   3. ZERO-GAP IMAGE STACK
   ============================================ */

.dz-landing-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: none;
    vertical-align: top;
    /* Removes bottom gap from inline-block behavior */

    /* Prevent image selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;

    /* Prevent image dragging */
    -webkit-user-drag: none;
    user-drag: none;
}

/* Smooth image loading */
.dz-landing-image[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dz-landing-image.loaded,
.dz-landing-image[loading="lazy"]:not([src=""]) {
    opacity: 1;
}

/* ============================================
   4. CHECKOUT SECTION
   ============================================ */

.dz-landing-checkout-section {
    padding: 0;
    /* Let the form handle its own spacing */
    background: #ffffff;
}

/* Override checkout form styles for landing page context */
.dz-landing-checkout-section .dz-checkout-container {
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Add some padding inside the form */
.dz-landing-checkout-section .dz-checkout-form-wrap {
    padding: 24px 16px;
}

@media (min-width: 768px) {
    .dz-landing-checkout-section .dz-checkout-form-wrap {
        padding: 32px 24px;
    }
}

/* ============================================
   5. MOBILE STICKY BUY BUTTON
   ============================================ */

.dz-sticky-buy {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    /* iOS safe area */
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 60%, rgba(255, 255, 255, 0));
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hide on larger screens */
@media (min-width: 769px) {
    .dz-sticky-buy {
        display: none;
    }
}

/* Hidden state (when checkout is visible) */
.dz-sticky-buy.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.dz-sticky-buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;

    /* Gradient background */
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #ffffff;

    /* Shadow for elevation */
    box-shadow:
        0 4px 14px rgba(22, 163, 74, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);

    /* Animation */
    transition: transform 0.2s ease, box-shadow 0.2s ease;

    /* Touch optimization */
    -webkit-tap-highlight-color: transparent;
}

.dz-sticky-buy-btn:active {
    transform: scale(0.98);
    box-shadow:
        0 2px 8px rgba(22, 163, 74, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.dz-sticky-buy-text {
    font-size: 17px;
}

.dz-sticky-buy-price {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 15px;
}

/* Pulse animation for attention */
@keyframes pulse-shadow {

    0%,
    100% {
        box-shadow:
            0 4px 14px rgba(22, 163, 74, 0.4),
            0 2px 4px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow:
            0 4px 20px rgba(22, 163, 74, 0.6),
            0 2px 6px rgba(0, 0, 0, 0.15);
    }
}

.dz-sticky-buy-btn {
    box-shadow:
        0 4px 14px rgba(22, 163, 74, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   6. ACCESSIBILITY & PERFORMANCE
   ============================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .dz-sticky-buy-btn {
        animation: none;
    }

    .dz-sticky-buy,
    .dz-landing-image[loading="lazy"] {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dz-sticky-buy-btn {
        border: 2px solid #000;
    }
}

/* Focus states for accessibility */
.dz-sticky-buy-btn:focus {
    outline: 3px solid #16a34a;
    outline-offset: 2px;
}

.dz-sticky-buy-btn:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   7. LOADING STATES
   ============================================ */

/* Skeleton loader for images */
.dz-landing-image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-out forwards;
    will-change: background-position;
    will-change: background-position;
    aspect-ratio: 9/16;
    /* Typical mobile image ratio */
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   8. PRINT STYLES
   ============================================ */

@media print {
    .dz-sticky-buy {
        display: none !important;
    }

    .dz-landing-wrapper {
        max-width: 100%;
        box-shadow: none;
    }
}