/* ==========================================================================
   ADVANCED ULTRACUSTOM CORE STYLESHEET
   PROJECT: FORTHiQ Knee Massager Pro+ Landing Page
   PALETTE DIRECTION: PURPLE ACCENTED PRESTIGE (Slight Muted Violet & Radiant Orchid)
   DESIGN ARCHITECTURE: MOLECULAR COMPOSITION WITH MULTI-LAYERED VARIABLE INJECTIONS
   ========================================================================== */

/* --- 1. ROOT VARIABLES DECLARATIONS (PURPLE SPECTRUM FOCUS) --- */
:root {
    --p-base-light: #faf8fe;
    --p-base-deep: #2e1065;
    --p-main-600: #7c3aed;
    --p-main-700: #6d28d9;
    --p-main-800: #5b21b6;
    --p-main-100: #ede9fe;
    --p-main-50: #f5f3ff;
    --p-main-glow: rgba(124, 58, 237, 0.15);
    --p-main-glow-intense: rgba(124, 58, 237, 0.4);
    
    --neutral-dark: #1f2937;
    --neutral-mid: #4b5563;
    --neutral-light: #f9fafb;
    --amazon-gold: #f0c14b;
    --amazon-gold-hover: #eeb933;
    --verified-green: #007600;
    --verified-bg: #e7f4e7;
    
    --font-stack: 'Inter', system-ui, -apple-system, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(46, 16, 101, 0.05), 0 4px 6px -2px rgba(46, 16, 101, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(46, 16, 101, 0.08), 0 10px 10px -5px rgba(46, 16, 101, 0.04);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- 2. BASE RESET & RESET IMPLEMENTATIONS --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--p-base-light);
    color: var(--neutral-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.text-purple-light {
    background-color: var(--p-base-light);
}

.text-purple-deep {
    color: var(--p-base-deep);
}

.bg-purple-tint {
    background-color: var(--p-main-50);
}

/* --- 3. BACKGROUND AMBIENT GLOW SYSTEM --- */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: 1;
    pointer-events: none;
    opacity: 0.45;
    mix-blend-mode: multiply;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--p-main-100);
    top: -100px;
    left: -200px;
    animation: driftOrb 15s infinite alternate ease-in-out;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: #fae8ff;
    top: 40%;
    right: -300px;
    animation: driftOrb 20s infinite alternate-reverse ease-in-out;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: var(--p-main-50);
    bottom: -100px;
    left: 20%;
}

@keyframes driftOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

/* --- 4. CUSTOM HEADER MECHANICS --- */
.custom-header {
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-b: 1px solid rgba(124, 58, 237, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

.header-title-text {
    font-size: 1.1rem;
    color: var(--p-base-deep);
    letter-spacing: 0.075em;
    background: linear-gradient(135deg, var(--p-base-deep) 0%, var(--p-main-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--p-main-600);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: var(--p-main-600);
    border-radius: 50%;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.header-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--p-main-600), transparent);
}

/* --- 5. ULTRA PREMIUM HERO CARD BLOCK --- */
.product-hero-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(124, 58, 237, 0.06);
    padding: 2rem;
    transition: var(--transition-smooth);
}

.product-hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--p-main-100), var(--p-main-600), var(--p-main-800), var(--p-main-100));
}

/* Structural Accent Pins */
.card-accent {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--p-main-100);
    pointer-events: none;
    opacity: 0.7;
}
.accent-tl { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.accent-tr { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.accent-bl { bottom: 16px; left: 16px; border-right: 0; border-top: 0; }
.accent-br { bottom: 16px; right: 16px; border-left: 0; border-top: 0; }

/* --- 6. ADVANCED CSS-ONLY ENGINE FOR GALLERY --- */
.interactive-gallery-engine {
    display: block;
    width: 100%;
}

.main-display-portal {
    border-radius: var(--radius-md);
    border: 1px solid rgba(124, 58, 237, 0.08);
    background-color: var(--neutral-light);
    box-shadow: var(--shadow-inner);
    overflow: hidden;
}

.portal-inner-glow {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 20px rgba(124, 58, 237, 0.03);
    pointer-events: none;
    z-index: 15;
}

.display-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 5;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
}

.display-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Active State Directives via Switch Engine */
#switch-media-1:checked ~ .main-display-portal .slide-index-1,
#switch-media-2:checked ~ .main-display-portal .slide-index-2,
#switch-media-3:checked ~ .main-display-portal .slide-index-3,
#switch-media-4:checked ~ .main-display-portal .slide-index-4 {
    opacity: 1;
    z-index: 10;
    position: relative;
}

/* Thumbnail Controller Cards Styling */
.thumb-control-card {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    background: var(--p-base-deep);
    opacity: 0.1;
    transition: var(--transition-smooth);
}

.thumb-control-card:hover .thumb-overlay {
    opacity: 0;
}

.thumb-control-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Synchronized Active Border States */
#switch-media-1:checked ~ .thumbnails-hub .control-idx-1,
#switch-media-2:checked ~ .thumbnails-hub .control-idx-2,
#switch-media-3:checked ~ .thumbnails-hub .control-idx-3,
#switch-media-4:checked ~ .thumbnails-hub .control-idx-4 {
    border-color: var(--p-main-600);
    box-shadow: 0 0 0 3px var(--p-main-glow);
    transform: scale(0.96);
}

#switch-media-1:checked ~ .thumbnails-hub .control-idx-1 .thumb-overlay,
#switch-media-2:checked ~ .thumbnails-hub .control-idx-2 .thumb-overlay,
#switch-media-3:checked ~ .thumbnails-hub .control-idx-3 .thumb-overlay,
#switch-media-4:checked ~ .thumbnails-hub .control-idx-4 .thumb-overlay {
    opacity: 0;
}

/* --- 7. TYPOGRAPHY AND CONTENT NODES ORCHESTRATION --- */
.badge-accent {
    background: linear-gradient(135deg, var(--p-main-600) 0%, var(--p-main-700) 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 50px;
    box-shadow: 0 2px 5px var(--p-main-glow);
}

.badge-neutral {
    background: var(--neutral-light);
    color: var(--p-main-700);
    border: 1px solid var(--p-main-100);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 50px;
}

.main-product-title {
    font-size: 1.8rem;
    color: var(--p-base-deep);
}

@media (min-width: 640px) {
    .main-product-title { font-size: 2.3rem; }
}

.title-underline {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--p-main-600);
    border-radius: 2px;
}

/* Narrative Segment Cards */
.narrative-segment-card {
    background: var(--neutral-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border-left: 4px solid var(--p-main-100);
    box-shadow: var(--shadow-sm);
}

.narrative-segment-card:hover {
    border-left-color: var(--p-main-600);
    transform: translateX(4px);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.segment-icon-box {
    width: 24px;
    height: 24px;
    background-color: var(--p-main-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.custom-check-icon::before {
    content: '✓';
    color: var(--p-main-700);
    font-weight: 900;
    font-size: 0.85rem;
}

.segment-title {
    font-size: 0.85rem;
    color: var(--p-base-deep);
}

.segment-text {
    margin-top: 0.25rem;
    font-weight: 400;
}

.keyword-disclaimer-card {
    box-shadow: var(--shadow-inner);
    border-radius: var(--radius-md);
}

/* --- 8. HIGH-IMPACT CTA PORTAL AREA --- */
.action-portal-section {
    background: linear-gradient(145deg, var(--p-base-deep) 0%, #1e0b45 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.portal-deco-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, transparent 100%);
    pointer-events: none;
}

.circle-l { width: 200px; height: 200px; top: -50px; left: -50px; }
.circle-r { width: 250px; height: 250px; bottom: -80px; right: -80px; }

.ultimate-cta-btn {
    background: linear-gradient(90deg, #9333ea 0%, var(--p-main-600) 50%, #9333ea 100%);
    background-size: 200% auto;
    padding: 1.25rem 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-bounce);
    animation: gradientFlow 4s infinite, softPulseBtn 2s infinite;
    display: inline-block;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes softPulseBtn {
    0% { box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4); }
    50% { box-shadow: 0 10px 35px var(--p-main-glow-intense); }
    100% { box-shadow: 0 10px 25px rgba(124, 58, 237, 0.4); }
}

.ultimate-cta-btn:hover {
    transform: translateY(-4px) scale(1.02);
    filter: brightness(1.1);
}

.ultimate-cta-btn:active {
    transform: translateY(-1px) scale(0.99);
}

/* --- 9. AMAZON-STYLE HIGH FIDELITY REVIEWS COMPONENT --- */
.reviews-display-hub {
    position: relative;
}

.headline-underline {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--p-main-600);
    border-radius: 2px;
}

.pipeline-review-item {
    padding-top: 1.5rem;
}

.pipeline-review-item:hover {
    transform: translateY(-1px);
}

.avatar-vault {
    width: 44px;
    height: 44px;
}

.avatar-rim {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--p-main-100);
    padding: 2px;
    background-color: white;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profile-name {
    color: var(--neutral-dark);
}

.review-title-text {
    letter-spacing: -0.01em;
}

.stars {
    color: var(--amazon-gold);
    text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}

.badge-verified-purchase {
    color: var(--verified-green);
    background-color: var(--verified-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    display: inline-block;
}

.review-main-text {
    font-weight: 400;
}

/* Attached Media Gallery within Reviews */
.attached-media-rack {
    margin-top: 0.75rem;
}

.media-preview-box {
    width: 84px;
    height: 84px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid #e5e7eb;
}

.media-box-border {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
}

.media-preview-box:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.media-preview-box:hover .media-box-border {
    border-color: var(--p-main-600);
}

/* --- 10. SYSTEM FOOTER CONVOLUTIONS --- */
.custom-footer {
    border-top: 1px solid var(--p-main-100);
    box-shadow: inset 0 10px 20px rgba(46, 16, 101, 0.01);
}

.footer-nav-link {
    color: var(--neutral-mid);
    position: relative;
    padding-bottom: 2px;
}

.footer-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background-color: var(--p-main-600);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
}

.footer-nav-link:hover {
    color: var(--p-main-700);
}

.footer-nav-link:hover::after {
    width: 100%;
}

.text-xxs {
    font-size: 0.65rem;
}

/* --- 11. MEDIA QUERIES & MOBILE-FIRST OVERRIDES --- */
@media (max-width: 639px) {
    .thumbnails-hub {
        gap: 2px;
    }
    
    .narrative-segment-card {
        padding: 1rem;
    }
    
    .pipeline-review-item {
        padding-bottom: 1.5rem;
    }
}

@media (max-width: 1023px) {
    .product-hero-card {
        padding: 1.25rem;
    }
}