/*
Theme Name: Med Compare UK
Version: 1.0.2
*/

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap; /* Critical for LCP */
    src: url('./assets/fonts/dm-sans-v17-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./assets/fonts/dm-sans-v17-latin-500.woff2') format('woff2');
}

@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./assets/fonts/dm-sans-v17-latin-700.woff2') format('woff2');
}


/* --- 1. Variables & Reset (Minimal) --- */
:root {
    --c-blue: #00247d;  /* UK Flag Navy */
    --c-red: #cf142b;   /* UK Flag Red */
    --c-dark: #1a1a1b;
    --c-bg: #ffffff;
    --font: 'DM Sans', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: var(--font); 
    color: var(--c-dark); 
    line-height: 1.5; 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* --- 2. Layout & Strict CLS Prevention --- */
.site-container { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; width: 100%; }

/* The fixed min-height prevents layout shifts when the logo loads */
.site-header { 
    min-height: 70px; 
    display: flex; 
    align-items: center; 
    border-bottom: 2px solid var(--c-blue); 
    position: relative; 
}
.site-header .container { display: flex; justify-content: space-between; align-items: center; }

/* Constrain logo so it never forces a shift */
.custom-logo { max-height: 45px; width: auto; object-fit: contain; }

/* --- 3. Base Menu Styles --- */
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation a { display: block; padding: 0.75rem 1rem; font-weight: 500; transition: color 0.2s; }
.sub-menu { display: none; } /* Dropdowns hidden by default */

/* --- 4. Mobile Menu (Slide from Right) --- */
@media (max-width: 767px) {
    /* Keep the toggle button above the sliding menu */
    .menu-toggle { 
        background: transparent; border: none; font-size: 1.8rem; 
        color: var(--c-blue); cursor: pointer; padding: 0.5rem; 
        position: relative; z-index: 10000; 
    }
    
    /* Create a dark background overlay */
    .main-navigation::before {
        content: '';
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    /* Show overlay when menu is open */
    .main-navigation.toggled::before {
        opacity: 1;
        visibility: visible;
    }
    
    /* Main mobile sliding drawer */
    .main-navigation ul#primary-menu { 
        display: block; /* Must be block, not none, for transform animation to work */
        position: fixed; 
        top: 0; 
        right: 0; 
        width: 80%; 
        max-width: 320px;
        height: 100vh; 
        background: var(--c-bg); 
        box-shadow: -4px 0 15px rgba(0,0,0,0.1); 
        z-index: 9999; 
        padding-top: 80px; /* Space so it doesn't overlap the header toggle */
        overflow-y: auto; 
        
        /* The hardware-accelerated slide animation */
        transform: translateX(100%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    }
    
    /* Slide the menu in when toggled */
    .main-navigation.toggled ul#primary-menu { 
        transform: translateX(0); 
    }
    
    /* Sub-menu styling */
    .sub-menu { display: none; background: #f8f9fa; padding-left: 1rem; border-left: 2px solid var(--c-blue); }
    
    /* Show sub-menu when parent is clicked */
    .menu-item-has-children.is-open > .sub-menu { display: block; }
    .main-navigation li { border-bottom: 1px solid #eee; }
}

/* --- 5. Desktop Menu (Hover) --- */
@media (min-width: 768px) {
    .menu-toggle { display: none; }
    
    .main-navigation ul#primary-menu { display: flex; align-items: center; gap: 1rem; }
    .main-navigation li { position: relative; }
    
    /* Show dropdown on hover */
    .main-navigation li:hover > .sub-menu,
    .main-navigation li:focus-within > .sub-menu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 220px;
        background: var(--c-bg);
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        border-top: 3px solid var(--c-red);
        z-index: 100;
    }
    
    .main-navigation a:hover { color: var(--c-red); }
}



.menu-item-has-children > a {
    position: relative;
    padding-right: 2rem !important; /* Make room for chevron */
}

/* Draw the chevron using pure CSS borders (zero images to load) */
.menu-item-has-children > a::after {
    content: '';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-60%) rotate(45deg);
    transition: transform 0.2s ease;
}

/* Rotate chevron pointing UP when menu is open (Mobile) or hovered (Desktop) */
@media (max-width: 767px) {
    .menu-item-has-children.is-open > a::after { transform: translateY(-30%) rotate(225deg); color: var(--c-red); }
}
@media (min-width: 768px) {
    .menu-item-has-children:hover > a::after,
    .menu-item-has-children:focus-within > a::after { transform: translateY(-30%) rotate(225deg); color: var(--c-red); }
}

/* Make sure the X icon on mobile is large enough */
.menu-toggle {
    line-height: 1;
    min-width: 44px; /* Accessible touch target size */
}



/* ==========================================================================
   Footer Bottom (Copyright & Links)
   ========================================================================== */

/* Mobile First: Stacked and Centered */
.footer-bottom {
    border-top: 1px solid #334155; /* Subtle dark divider line */
    padding-top: 1.5rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    font-size: 0.875rem; /* Slightly smaller text for the bottom */
    color: #94a3b8; /* Muted gray text */
}

.footer-legal a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: var(--c-red); /* Hover uses your UK flag red */
}

.footer-legal .separator {
    margin: 0 0.5rem;
    opacity: 0.3;
}

/* Desktop: Side-by-Side */
@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}


/* ==========================================================================
   Mounjaro Profile Specific Styles
   ========================================================================== */
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.bg-light { background-color: var(--c-bg); }

/* Card Panels */
.card-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card-panel h2, .card-panel h3 {
    font-size: 1.25rem;
    color: var(--c-blue);
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

/* Hero Section */
.pharmacy-hero {
    margin-bottom: 2rem;
}

.hero-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.pharmacy-avatar {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 4px;
}

.pharmacy-title {
    font-size: 1.6rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--c-dark);
}

/* Trust Badges */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.badge-gphc { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge-trustpilot { background: #1c1c1c; color: #00b67a; } /* Trustpilot colors */

/* CSS Checkmark */
.icon-check {
    display: inline-block;
    width: 10px; height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

/* Coupon Box */
.coupon-box {
    background: #fff0f2;
    border: 2px dashed var(--c-red);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.coupon-code span {
    background: var(--c-red);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Pricing List */
.pricing-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.price-row .strength { font-weight: 600; font-size: 0.95rem;}
.price-row .price { font-weight: 700; color: var(--c-blue); font-size: 1.1rem;}

/* Details Specs List */
.specs-list { list-style: none; }
.specs-list li {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}
.specs-list li:last-child { border-bottom: none; }

.spec-label { font-size: 0.85rem; color: #64748b; margin-bottom: 0.25rem; }
.spec-value { font-weight: 500; font-size: 0.95rem; }
.spec-value.yes { color: #166534; }
.spec-value.no { color: var(--c-red); }

/* Small Tags */
.spec-value.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; mt: 0.2rem; }
.tag { background: #f1f5f9; color: #475569; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }

/* Process Blocks */
.process-block { margin-bottom: 1.25rem; }
.process-block h3 { font-size: 1.05rem; color: var(--c-dark); border: none; margin-bottom: 0.4rem; padding-bottom: 0;}
.process-block p { font-size: 0.95rem; color: #475569; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--c-red); color: #fff; }
.btn-primary:hover { background: #a50f22; color: #fff;}
.btn-full { width: 100%; display: block; }

/* --- Desktop Layout --- */
@media (min-width: 768px) {
    .hero-top {
        flex-direction: row;
        text-align: left;
    }
    
    .hero-content {
        flex: 1;
        padding: 0 1.5rem;
    }
    
    .trust-badges { justify-content: flex-start; }
    .hero-action { min-width: 200px; }
    
    .pharmacy-grid {
        display: grid;
        grid-template-columns: 2fr 1fr; /* 66% Main / 33% Sidebar */
        gap: 1.5rem;
    }
    
    .coupon-box {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .specs-list li {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .spec-label { margin-bottom: 0; }
    .spec-value.tags { justify-content: flex-end; }
}