/**
 * COD PageCraft Frontend Styles
 * Mobile-First, High-Converting E-Commerce COD Landing Page Aesthetics
 */

/* ==========================================================================
   Typography & Base Reset
   ========================================================================== */
.cod-image-wrapper,
.cod-btn-container,
.cod-ba-wrapper,
.cod-reviews-wrapper {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.cod-image-wrapper *,
.cod-btn-container *,
.cod-ba-wrapper *,
.cod-reviews-wrapper * {
    box-sizing: border-box;
}

/* ==========================================================================
   1. COD Page Image Block
   ========================================================================== */
.cod-image-wrapper {
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.cod-image-element {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0 auto;
}

.cod-image-link {
    display: block;
    text-decoration: none;
}

.cod-has-shadow {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Aspect Ratios */
.cod-ratio-2-3 { aspect-ratio: 2 / 3; }
.cod-ratio-9-16 { aspect-ratio: 9 / 16; }
.cod-ratio-1-1 { aspect-ratio: 1 / 1; }
.cod-ratio-3-2 { aspect-ratio: 3 / 2; }

.cod-fit-cover img { object-fit: cover; }
.cod-fit-contain img { object-fit: contain; }

/* ==========================================================================
   2. COD Page Button Block (6 Styles & 5 Animations)
   ========================================================================== */
.cod-btn-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 0 16px;
    text-align: center;
}

.cod-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 28px;
    font-size: 19px;
    font-weight: 800;
    text-decoration: none !important;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    line-height: 1.3;
}

.cod-btn-width-full {
    width: 100%;
}

.cod-btn-width-standard {
    width: auto;
    min-width: 280px;
}

/* 6 PageCraft Button Styles */
.cod-btn-solid {
    background-color: var(--cod-btn-bg, #660033);
    color: var(--cod-btn-text, #ffffff) !important;
    border-radius: 12px;
}

.cod-btn-pill {
    background-color: var(--cod-btn-bg, #660033);
    color: var(--cod-btn-text, #ffffff) !important;
    border-radius: 9999px;
}

.cod-btn-soft {
    background-color: rgba(102, 0, 51, 0.12);
    color: var(--cod-btn-bg, #660033) !important;
    border: 2px solid var(--cod-btn-bg, #660033);
    border-radius: 12px;
}

.cod-btn-icon {
    background-color: var(--cod-btn-bg, #660033);
    color: var(--cod-btn-text, #ffffff) !important;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(102, 0, 51, 0.35);
}

.cod-btn-gradient {
    background: linear-gradient(135deg, var(--cod-btn-bg, #660033) 0%, #5c0120 100%);
    color: var(--cod-btn-text, #ffffff) !important;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(102, 0, 51, 0.35);
}

.cod-btn-shadow {
    background-color: var(--cod-btn-bg, #660033);
    color: var(--cod-btn-text, #ffffff) !important;
    border-radius: 12px;
    box-shadow: 0 8px 0 #5c0120, 0 12px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.cod-btn-shadow:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #5c0120, 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cod-btn-svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.cod-btn-subtext {
    margin: 8px 0 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

/* 5 PageCraft Animations */
/* 1. Pulse Glow */
.cod-motion-pulse {
    animation: codPulse var(--cod-btn-speed, 1.2s) infinite ease-in-out;
}
@keyframes codPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 14px rgba(22, 163, 74, 0);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
        transform: scale(1);
    }
}

/* 2. Bounce */
.cod-motion-bounce {
    animation: codBounce var(--cod-btn-speed, 1.2s) infinite ease-in-out;
}
@keyframes codBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

/* 3. Shimmer (Reflective Sheen Sweep) */
.cod-motion-shimmer {
    position: relative;
    overflow: hidden;
}
.cod-motion-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: codShimmer var(--cod-btn-speed, 1.8s) infinite ease;
}
@keyframes codShimmer {
    0% { left: -100%; }
    100% { left: 160%; }
}

/* 4. Heartbeat */
.cod-motion-heartbeat {
    animation: codHeartbeat var(--cod-btn-speed, 1.2s) infinite ease-in-out;
}
@keyframes codHeartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.05); }
    28% { transform: scale(1); }
    42% { transform: scale(1.05); }
    70% { transform: scale(1); }
}

/* 5. Shake */
.cod-motion-shake {
    animation: codShake var(--cod-btn-speed, 2.2s) infinite ease-in-out;
}
@keyframes codShake {
    0%, 80%, 100% { transform: translateX(0); }
    82% { transform: translateX(-4px) rotate(-1deg); }
    84% { transform: translateX(4px) rotate(1deg); }
    86% { transform: translateX(-4px) rotate(-1deg); }
    88% { transform: translateX(4px) rotate(1deg); }
    90% { transform: translateX(0); }
}

/* ==========================================================================
   3. COD Page Before / After Comparison
   ========================================================================== */
.cod-ba-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
}

.cod-ba-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.cod-ba-image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cod-ba-image-layer img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.cod-ba-label {
    position: absolute;
    top: 14px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    backdrop-filter: blur(6px);
    z-index: 5;
    letter-spacing: 0.5px;
}

.cod-ba-label-before {
    left: 14px;
}

.cod-ba-label-after {
    right: 14px;
}

/* Handle */
.cod-ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    transform: translateX(-50%);
    cursor: ew-resize;
    z-index: 10;
}

.cod-ba-handle-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1px;
    width: 2px;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.cod-ba-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.cod-ba-handle-circle svg {
    width: 18px;
    height: 18px;
}

/* Auto Transition Mode */
.cod-ba-mode-auto .cod-ba-before {
    clip-path: none !important;
    animation: codBaCrossfade var(--cod-ba-duration, 5s) infinite ease-in-out;
}

@keyframes codBaCrossfade {
    0%, 45% { opacity: 1; }
    55%, 95% { opacity: 0; }
    100% { opacity: 1; }
}

/* ==========================================================================
   4. COD Page Reviews Block
   ========================================================================== */
.cod-reviews-wrapper {
    width: 100%;
    max-width: 640px;
    margin: 30px auto;
    padding: 0 16px;
}

.cod-reviews-title {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 20px 0;
}

.cod-reviews-slider {
    position: relative;
    overflow: hidden;
}

.cod-reviews-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 4px 20px 4px;
}

.cod-reviews-track::-webkit-scrollbar {
    display: none;
}

.cod-review-card {
    flex: 0 0 85%;
    max-width: 320px;
    scroll-snap-align: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

@media (min-width: 600px) {
    .cod-review-card {
        flex: 0 0 48%;
    }
}

.cod-review-screenshot {
    width: 100%;
    background: #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.cod-review-screenshot img {
    width: 100%;
    height: auto;
    display: block;
}

.cod-review-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cod-review-stars {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.cod-review-text {
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    margin: 0 0 12px 0;
    flex: 1;
}

.cod-review-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.cod-review-name {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.cod-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 999px;
}

.cod-verified-badge svg {
    width: 14px;
    height: 14px;
}

.cod-reviews-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

.cod-review-arrow {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cod-review-arrow:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.cod-reviews-dots {
    display: flex;
    gap: 6px;
}

.cod-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.cod-dot.active {
    background: #660033;
    width: 20px;
    border-radius: 999px;
}

/* ==========================================================================
   COD Reviews: Dynamic Color Variables & 10 Visual Styles
   ========================================================================== */
.cod-reviews-wrapper {
    --cod-rev-bg: #ffffff;
    --cod-rev-text: #334155;
    --cod-rev-name: #0f172a;
    --cod-rev-star: #f59e0b;
    --cod-rev-accent: #660033;
}

.cod-review-card {
    background: var(--cod-rev-card-bg, var(--cod-rev-bg));
    color: var(--cod-rev-text);
}

.cod-review-stars {
    color: var(--cod-rev-star) !important;
}

.cod-review-name {
    color: var(--cod-rev-name) !important;
}

.cod-review-text {
    color: var(--cod-rev-text) !important;
}

/* Grid Layout Mode */
.cod-reviews-layout-grid .cod-reviews-track {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
}

.cod-reviews-layout-grid .cod-review-card {
    flex: none !important;
    max-width: 100% !important;
}

.cod-reviews-layout-grid .cod-reviews-nav {
    display: none !important;
}

/* 1. Classic Elevated Cards */
.cod-reviews-style-classic-cards .cod-review-card {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cod-reviews-style-classic-cards .cod-review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -8px rgba(0, 0, 0, 0.12);
}

/* 2. WhatsApp Chat Style */
.cod-reviews-style-whatsapp-chat .cod-reviews-slider {
    background: #efeae2;
    padding: 18px 12px;
    border-radius: 20px;
    background-image: radial-gradient(#d4cbbe 1px, transparent 1px);
    background-size: 16px 16px;
}

.cod-reviews-style-whatsapp-chat .cod-review-card {
    background: var(--cod-rev-card-bg, #ffffff) !important;
    border: none;
    border-radius: 12px 12px 2px 12px;
    box-shadow: 0 2px 5px rgba(11, 20, 26, 0.13);
    position: relative;
}

.cod-reviews-style-whatsapp-chat .cod-review-author {
    border-top: none;
    padding-top: 4px;
    font-size: 12px;
    color: #667781;
}

.cod-reviews-style-whatsapp-chat .cod-verified-badge {
    background: #e7f8e8;
    color: #128c7e;
    font-size: 10.5px;
}

.cod-reviews-style-whatsapp-chat .cod-whatsapp-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #667781;
    margin-top: 4px;
    justify-content: flex-end;
}

.cod-reviews-style-whatsapp-chat .cod-whatsapp-checks {
    color: #53bdeb;
    font-weight: bold;
    letter-spacing: -2px;
}

/* 3. Visual Screenshots Gallery */
.cod-reviews-style-screenshot-gallery .cod-review-card {
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    background: var(--cod-rev-card-bg, #ffffff);
}

.cod-reviews-style-screenshot-gallery .cod-review-screenshot {
    max-height: 240px;
    overflow: hidden;
}

.cod-reviews-style-screenshot-gallery .cod-review-screenshot img {
    transition: transform 0.3s ease;
}

.cod-reviews-style-screenshot-gallery .cod-review-card:hover .cod-review-screenshot img {
    transform: scale(1.04);
}

/* 4. Modern Minimalist */
.cod-reviews-style-modern-minimal .cod-review-card {
    background: var(--cod-rev-card-bg, transparent);
    border: 2px solid #cbd5e1;
    box-shadow: none;
    border-radius: 12px;
}

.cod-reviews-style-modern-minimal .cod-verified-badge {
    background: transparent;
    border: 1px solid #16a34a;
}

/* 5. Dark Luxury & Gold */
.cod-reviews-style-dark-luxury .cod-review-card {
    background: var(--cod-rev-card-bg, #1a0f16) !important;
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cod-reviews-style-dark-luxury .cod-review-name {
    color: var(--cod-rev-name, #fef08a) !important;
}

.cod-reviews-style-dark-luxury .cod-review-text {
    color: var(--cod-rev-text, #f1f5f9) !important;
}

.cod-reviews-style-dark-luxury .cod-verified-badge {
    background: rgba(245, 158, 11, 0.15);
    color: #fde047;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 6. Speech Bubbles */
.cod-reviews-style-speech-bubbles .cod-review-card {
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
}

.cod-reviews-style-speech-bubbles .cod-review-content {
    background: var(--cod-rev-card-bg, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.cod-reviews-style-speech-bubbles .cod-review-content::after {
    content: '';
    position: absolute;
    bottom: -9px;
    right: 28px;
    width: 16px;
    height: 16px;
    background: var(--cod-rev-card-bg, #f8fafc);
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transform: rotate(45deg);
}

.cod-reviews-style-speech-bubbles .cod-review-author {
    margin-top: 14px;
    padding-top: 0;
    border-top: none;
}

/* 7. GCC Trust & Saudi/Gulf Badge */
.cod-reviews-style-gcc-badges .cod-review-card {
    border: 2px solid #f3d5e2;
    border-radius: 16px;
    position: relative;
    background: var(--cod-rev-card-bg, #ffffff);
}

.cod-reviews-style-gcc-badges .cod-gcc-badge-header {
    background: linear-gradient(135deg, #660033 0%, #4a0025 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cod-reviews-style-gcc-badges .cod-verified-badge {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* 8. Compact Floating Bar */
.cod-reviews-style-compact-strip .cod-review-card {
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: var(--cod-rev-card-bg, #ffffff);
    max-width: 100%;
}

.cod-reviews-style-compact-strip .cod-review-content {
    padding: 0 10px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.cod-reviews-style-compact-strip .cod-review-text {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.cod-reviews-style-compact-strip .cod-review-author {
    border-top: none;
    padding: 0;
}

/* 9. Social Media Feed / Masonry */
.cod-reviews-style-masonry-feed .cod-review-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: var(--cod-rev-card-bg, #ffffff);
}

.cod-reviews-style-masonry-feed .cod-social-user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 6px 14px;
}

.cod-reviews-style-masonry-feed .cod-social-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #660033;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.cod-reviews-style-masonry-feed .cod-social-action-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: #e11d48;
    border-top: 1px solid #f1f5f9;
}

/* 10. Editorial Big Quotes */
.cod-reviews-style-editorial-quotes .cod-review-card {
    position: relative;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: var(--cod-rev-card-bg, #ffffff);
}

.cod-reviews-style-editorial-quotes .cod-editorial-quote-mark {
    position: absolute;
    top: 6px;
    right: 14px;
    font-size: 64px;
    line-height: 1;
    color: var(--cod-rev-accent, #660033);
    opacity: 0.12;
    font-family: Georgia, serif;
    pointer-events: none;
}

.cod-reviews-style-editorial-quotes .cod-review-text {
    font-size: 15px;
    font-style: italic;
    font-weight: 500;
}

