/* ==========================================================================
   GLOBAL.CSS — Design System, Reset, Tokens, Utilities
   U & I Medicine Point
   ========================================================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    /* Brand Colors */
    --color-primary:          #00897B;   /* Teal/green — CTAs, links */
    --color-primary-dark:     #00695C;   /* Hover state */
    --color-primary-light:    #E0F2F1;   /* Light tint */
    --color-secondary:        #1A237E;   /* Deep navy */
    --color-accent:           #F4511E;   /* Orange — sale badges */
    --color-success:          #2E7D32;
    --color-warning:          #F57F17;
    --color-danger:           #C62828;
    --color-info:             #0277BD;

    /* Neutrals */
    --color-white:            #FFFFFF;
    --color-surface:          #F7F9FC;
    --color-surface-alt:      #EEF2F7;
    --color-border:           #E2E8F0;
    --color-border-dark:      #CBD5E1;

    /* Text */
    --color-text:             #1A202C;
    --color-text-secondary:   #4A5568;
    --color-text-muted:       #718096;
    --color-text-inverse:     #FFFFFF;

    /* Typography */
    --font-base:              'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-xs:                0.75rem;    /* 12px */
    --text-sm:                0.875rem;   /* 14px */
    --text-base:              1rem;       /* 16px */
    --text-lg:                1.125rem;   /* 18px */
    --text-xl:                1.25rem;    /* 20px */
    --text-2xl:               1.5rem;     /* 24px */
    --text-3xl:               1.875rem;   /* 30px */
    --text-4xl:               2.25rem;    /* 36px */
    --text-5xl:               3rem;       /* 48px */
    --font-weight-normal:     400;
    --font-weight-medium:     500;
    --font-weight-semibold:   600;
    --font-weight-bold:       700;
    --font-weight-extrabold:  800;
    --line-height-tight:      1.2;
    --line-height-base:       1.6;
    --line-height-relaxed:    1.8;

    /* Spacing (4px base) */
    --space-0:   0;
    --space-1:   0.25rem;   /* 4px */
    --space-2:   0.5rem;    /* 8px */
    --space-3:   0.75rem;   /* 12px */
    --space-4:   1rem;      /* 16px */
    --space-5:   1.25rem;   /* 20px */
    --space-6:   1.5rem;    /* 24px */
    --space-8:   2rem;      /* 32px */
    --space-10:  2.5rem;    /* 40px */
    --space-12:  3rem;      /* 48px */
    --space-16:  4rem;      /* 64px */
    --space-20:  5rem;      /* 80px */

    /* Border Radius */
    --radius-sm:    4px;
    --radius-base:  8px;
    --radius-md:    10px;
    --radius-lg:    16px;
    --radius-xl:    24px;
    --radius-2xl:   32px;
    --radius-full:  9999px;

    /* Shadows */
    --shadow-xs:    0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm:    0 2px 8px rgba(0,0,0,0.08);
    --shadow-base:  0 4px 16px rgba(0,0,0,0.10);
    --shadow-md:    0 8px 24px rgba(0,0,0,0.12);
    --shadow-lg:    0 16px 40px rgba(0,0,0,0.15);
    --shadow-xl:    0 24px 64px rgba(0,0,0,0.18);

    /* Transitions */
    --transition-fast:   150ms ease;
    --transition-base:   250ms ease;
    --transition-slow:   400ms ease;

    /* Layout */
    --container-max:     1200px;
    --container-pad:     1.5rem;
    --header-height:     70px;
}

/* ---- Modern Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-base);
    font-size: var(--text-base);
    font-weight: var(--font-weight-normal);
    color: var(--color-text);
    background: var(--color-white);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Astra overrides */
body.ast-no-sidebar .ast-article-post,
body.ast-no-sidebar .ast-article-inner { max-width: none; }
.ast-container { max-width: none !important; padding: 0 !important; }
#ast-fixed-header { display: none !important; }
.ast-header-break-point .ast-primary-header-bar { display: none !important; }
.main-header-bar,
.ast-above-header-bar,
.ast-below-header-bar,
.main-header-bar-wrap,
.ast-masthead-custom-menu-items,
.ast-primary-header-bar,
#ast-desktop-header { display: none !important; }
#colophon { display: none !important; } /* Hide Astra's default footer only */

/* ---- Astra Scroll-to-Top: fix position + flip icon to point UP ---- */
#ast-scroll-top {
    /* Force to bottom-RIGHT corner */
    position: fixed !important;
    bottom: 28px !important;
    right: 24px !important;
    left: auto !important;

    /* Style to match our brand */
    width: 44px !important;
    height: 44px !important;
    background: var(--color-primary) !important;
    border-radius: var(--radius-full) !important;
    box-shadow: 0 4px 16px rgba(0,137,123,0.35) !important;
    cursor: pointer;
    transition: background 250ms ease, transform 250ms ease, box-shadow 250ms ease !important;
    z-index: 996 !important;

    /* Centre the icon — but DON'T force display so Astra JS can still hide it */
    align-items: center !important;
    justify-content: center !important;
    line-height: 0 !important;
}
/* When Astra JS sets display:block, upgrade to flex for centred icon */
#ast-scroll-top[style*="display: block"],
#ast-scroll-top[style*="display:block"] {
    display: flex !important;
}
#ast-scroll-top:hover {
    background: var(--color-primary-dark) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(0,137,123,0.5) !important;
}
/* Rotate 180° — Astra's SVG points DOWN, we need UP */
#ast-scroll-top .ast-arrow-svg {
    transform: rotate(180deg) !important;
    width: 18px !important;
    height: 18px !important;
}
/* White arrow */
#ast-scroll-top .ast-arrow-svg path {
    fill: #ffffff !important;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-primary-dark); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
}

/* ---- Container ---- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    width: 100%;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.65rem 1.5rem;
    font-family: var(--font-base);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-base);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-base);
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    outline: none;
}
.btn-sm  { padding: 0.45rem 1rem; font-size: var(--text-xs); }
.btn-lg  { padding: 0.875rem 2rem; font-size: var(--text-base); border-radius: var(--radius-md); }

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,137,123,0.3);
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,137,123,0.4);
}
.btn-white {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
    font-weight: var(--font-weight-bold);
}
.btn-white:hover {
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}
.btn-outline-white {
    background: transparent;
    color: var(--color-white);
    border-color: rgba(255,255,255,0.7);
}
.btn-outline-white:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--color-white);
}

/* ---- Form Elements ---- */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.65rem 1rem;
    font-family: var(--font-base);
    font-size: var(--text-sm);
    color: var(--color-text);
    background: var(--color-white);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
    appearance: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0,137,123,0.12);
}
.form-textarea { resize: vertical; min-height: 100px; }

/* ---- Section headers ---- */
.section-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
}
.section-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-8);
}

/* ---- Badges ---- */
.product-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.02em;
    line-height: 1;
}
.product-badge--discount { background: var(--color-accent); color: #fff; }
.product-badge--rx       { background: var(--color-warning); color: #fff; }
.product-badge--oos      { background: #9E9E9E; color: #fff; }
.product-badge--new      { background: var(--color-info); color: #fff; }

/* ---- Utilities ---- */
.hide-mobile  { display: flex !important; }
.hide-desktop { display: none !important; }
.text-center  { text-align: center; }
.text-muted   { color: var(--color-text-muted); }
.fw-bold      { font-weight: var(--font-weight-bold); }
.screen-reader-text { position: absolute; left: -9999px; }

/* ---- Standard Page Templates ---- */
.standard-page-wrapper {
    padding: var(--space-12) 0;
    background-color: var(--color-surface);
    min-height: 60vh;
}
.standard-page-container {
    max-width: 800px;
    background: var(--color-white);
    padding: var(--space-8) var(--space-10);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 0 auto;
}
.standard-page-header {
    margin-bottom: var(--space-8);
    text-align: center;
}
.standard-page-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-secondary);
    margin-bottom: var(--space-2);
    text-transform: capitalize;
}
.standard-page-title-line {
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    margin: var(--space-4) auto 0;
    border-radius: var(--radius-full);
}
.standard-page-content {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    font-size: var(--text-base);
}
.standard-page-content h2,
.standard-page-content h3 {
    color: var(--color-secondary);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
    font-weight: var(--font-weight-bold);
}
.standard-page-content p {
    margin-bottom: var(--space-4);
}
.standard-page-content ul {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}
.standard-page-content li {
    margin-bottom: var(--space-2);
}

@media (max-width: 768px) {
    .standard-page-wrapper {
        padding: var(--space-6) 0;
    }
    .standard-page-container {
        padding: var(--space-6) var(--space-4);
        border-radius: 0;
        box-shadow: none;
    }
    .standard-page-title {
        font-size: var(--text-2xl);
    }
}

