/*
 * FILE: /appmedia/styles.css
 * PURPOSE: V2 SPA shell CSS — header, nav, footer, base layout.
 * DESIGN: Full magenta header (brand color #ec008c), white content area,
 *         white mega-menu drop, clean 3-tier header structure.
 * RAG-KEYWORDS: shell CSS, header styles, footer styles, navigation, base layout
 */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
    /* Core */
    --pgr-bg:           #f8f9fb;
    --pgr-back:         #ffffff;
    --pgr-color:        #1a1a2e;

    /* Brand magenta */
    --pgr-accent:       #ec008c;
    --pgr-accent-h:     #c8007a;
    --pgr-accent-dark:  #c40079;   /* top-strip shade — slightly deeper */
    --pgr-accent-nav:   #d4007f;   /* nav bar — between top & main */

    /* Greys */
    --pgr-light:        #6b7280;
    --pgr-lighter:      #9ca3af;
    --pgr-border:       #e5e7eb;

    /* Shadows */
    --pgr-shadow-sm:    0 2px 8px rgba(0,0,0,0.08);
    --pgr-shadow:       0 4px 20px rgba(0,0,0,0.10);
    --pgr-shadow-lg:    0 12px 40px rgba(0,0,0,0.14);
    --pgr-shadow-xl:    0 20px 60px rgba(0,0,0,0.18);

    /* Radius */
    --pgr-radius-sm:    8px;
    --pgr-radius:       12px;
    --pgr-radius-lg:    18px;

    /* Ease */
    --pgr-ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* Typography */
    --pgr-font-brand:   'Catamaran', sans-serif;
    --pgr-font-body:    'Inter', sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--pgr-font-body);
    background: var(--pgr-bg);
    color: var(--pgr-color);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Layout container ───────────────────────────────────────────────────────── */
.pgr-header-inner,
.pgr-footer-inner,
.pgr-nav-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 28px;
    width: 100%;
}

/* ══════════════════════════════════════════════════════
   HEADER — full magenta, 3-tier
══════════════════════════════════════════════════════ */
.pgr-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--pgr-accent);
    box-shadow: 0 4px 24px rgba(236,0,140,0.35), 0 1px 0 rgba(0,0,0,0.08);
    transition: box-shadow 0.3s var(--pgr-ease);
}
.pgr-header--scrolled {
    box-shadow: 0 8px 40px rgba(236,0,140,0.45), 0 1px 0 rgba(0,0,0,0.10);
}

/* ── Tier 1: Top info strip ── */
.pgr-header-top {
    height: 34px;
    display: flex;
    align-items: center;
    background: var(--pgr-accent-dark);  /* slightly deeper magenta */
}
.pgr-header-top .pgr-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pht-left { display: flex; align-items: center; }
.pht-delivery-info {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.02em;
}
.pht-right { display: flex; align-items: center; gap: 20px; }
.pht-link {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    transition: color 0.15s;
    letter-spacing: 0.01em;
}
.pht-link:hover { color: #fff; }
.pht-login {
    color: #fff;
    font-weight: 600;
    padding: 3px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    transition: background 0.15s, border-color 0.15s;
    font-size: 12px;
}
.pht-login:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.5);
}

/* ── Tier 2: Main bar — logo + search + cart ── */
.pgr-header-main {
    height: 68px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.pgr-header-main .pgr-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo */
.phm-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.pgr-logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}
.pgr-logo-text {
    font-family: var(--pgr-font-brand);
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

/* Search */
.phm-search {
    flex: 1;
    max-width: 540px;
    position: relative;
}
.pgr-search-wrap {
    display: flex;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.pgr-search-wrap:focus-within {
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.18), 0 0 0 3px rgba(255,255,255,0.25);
}
.pgr-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 11px 16px;
    font-size: 14px;
    font-family: var(--pgr-font-body);
    color: var(--pgr-color);
    outline: none;
}
.pgr-search-input::placeholder { color: #9ca3af; }
.pgr-search-btn {
    padding: 0 16px;
    color: var(--pgr-accent);
    display: flex;
    align-items: center;
    background: #fff;
    transition: color 0.15s;
}
.pgr-search-btn:hover { color: var(--pgr-accent-h); }
.pgr-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--pgr-border);
    border-radius: var(--pgr-radius);
    box-shadow: var(--pgr-shadow-xl);
    z-index: 200;
    padding: 6px 0;
}

/* Actions */
.phm-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.pgr-cart-btn {
    position: relative;
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.85);
    transition: background 0.15s, color 0.15s;
}
.pgr-cart-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.pgr-cart-count {
    position: absolute;
    top: 4px; right: 4px;
    background: #fff;
    color: var(--pgr-accent);
    font-size: 9px;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}
.pgr-mobile-menu-btn {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: none;
    align-items: center; justify-content: center;
    color: rgba(255,255,255,0.85);
    transition: background 0.15s, color 0.15s;
}
.pgr-mobile-menu-btn:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

/* ── Tier 3: Category nav bar ── */
.pgr-header-nav {
    height: 44px;
    display: flex;
    align-items: center;
    background: var(--pgr-accent-nav);  /* slightly deeper than main */
}
.pgr-nav-inner { display: flex; align-items: center; }
.pgr-nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    height: 44px;
}
.pgr-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.pgr-nav-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255,255,255,0.80);
    white-space: nowrap;
    letter-spacing: 0.01em;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.pgr-nav-item:hover > .pgr-nav-link,
.pgr-nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.10);
    border-bottom-color: #fff;
}
.pgr-nav-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.2);
    margin: 0 4px;
    align-self: center;
}
.pgr-nav-deal {
    color: #fff !important;
    font-weight: 700;
}

/* ── Mega menu — drops white below magenta nav ── */
.pgr-mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -20px;
    min-width: 560px;
    background: #fff;
    border: 1px solid var(--pgr-border);
    border-top: 3px solid var(--pgr-accent);
    border-radius: 0 0 var(--pgr-radius) var(--pgr-radius);
    box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08);
    padding: 22px 26px 28px;
    z-index: 500;
    animation: pgrFadeDown 0.16s var(--pgr-ease);
}
.pgr-nav-item:hover .pgr-mega-menu { display: block; }
@keyframes pgrFadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pgr-mega-cols {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.pgr-mega-col h6 {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--pgr-accent);
    margin: 0 0 10px;
}
.pgr-mega-col a {
    display: block;
    font-size: 13px;
    color: #374151;
    padding: 5px 0;
    transition: color 0.12s, transform 0.12s;
}
.pgr-mega-col a:hover {
    color: var(--pgr-accent);
    transform: translateX(3px);
}

/* ══════════════════════════════════════════════════════
   MOBILE DRAWER
══════════════════════════════════════════════════════ */
.pgr-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 900;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.pgr-mobile-overlay.active { display: block; }
.pgr-mobile-drawer {
    position: fixed;
    top: 0; right: -340px;
    width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    transition: right 0.32s var(--pgr-ease);
    overflow-y: auto;
    box-shadow: -8px 0 48px rgba(0,0,0,0.18);
}
.pgr-mobile-drawer.open { right: 0; }
.pgr-mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    background: var(--pgr-accent);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}
.pgr-mobile-close {
    font-size: 26px;
    color: rgba(255,255,255,0.8);
    line-height: 1;
    transition: color 0.15s;
}
.pgr-mobile-close:hover { color: #fff; }
.pgr-mobile-nav a {
    display: block;
    padding: 14px 22px;
    font-size: 15px;
    border-bottom: 1px solid var(--pgr-border);
    color: var(--pgr-color);
    transition: background 0.12s, color 0.12s, padding-left 0.12s;
}
.pgr-mobile-nav a:hover {
    background: #fdf0f8;
    color: var(--pgr-accent);
    padding-left: 28px;
}

/* ══════════════════════════════════════════════════════
   MAIN CONTENT AREA
══════════════════════════════════════════════════════ */
#pgr-app { flex: 1; min-height: 60vh; }

/* ── Loader ── */
.pgr-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
}
.pgr-loader-inner {
    display: flex;
    gap: 10px;
    align-items: center;
}
.pgr-loader-dot {
    width: 10px; height: 10px;
    background: var(--pgr-accent);
    border-radius: 50%;
    animation: pgrBounce 1.3s infinite var(--pgr-ease);
}
.pgr-loader-dot:nth-child(1) { animation-delay: 0s; }
.pgr-loader-dot:nth-child(2) { animation-delay: 0.18s; }
.pgr-loader-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes pgrBounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
    40%           { transform: scale(1);   opacity: 1;   }
}

/* ── Error ── */
.pgr-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    padding: 48px;
}
.pgr-error h2 {
    font-family: var(--pgr-font-brand);
    font-size: 80px;
    font-weight: 900;
    color: var(--pgr-border);
    margin: 0 0 12px;
    line-height: 1;
}
.pgr-error p { color: var(--pgr-light); font-size: 16px; }

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
.pgr-footer {
    background: var(--pgr-color);
    color: rgba(255,255,255,0.65);
    margin-top: auto;
}
.pgr-footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 28px;
}

.pgr-footer-top {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
    gap: 48px;
    padding: 56px 0 48px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Brand */
.pgr-footer-logo { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.pgr-footer-logo-icon {
    width: 28px; height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}
.pgr-footer-logo span {
    font-family: var(--pgr-font-brand);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.4px;
}
.pgr-footer-tagline {
    font-size: 13px;
    line-height: 1.75;
    color: rgba(255,255,255,0.4);
    max-width: 260px;
    margin: 0 0 22px;
}
.pgr-footer-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.pgr-badge {
    font-size: 11px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 4px 11px;
    color: rgba(255,255,255,0.55);
}

/* Link cols */
.pgr-footer-col h5 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--pgr-accent);
    margin: 0 0 16px;
}
.pgr-footer-col a {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    padding: 5px 0;
    transition: color 0.15s, padding-left 0.12s;
}
.pgr-footer-col a:hover {
    color: rgba(255,255,255,0.9);
    padding-left: 3px;
}

/* Bottom */
.pgr-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 16px;
    flex-wrap: wrap;
}
.pgr-footer-copy { font-size: 12px; color: rgba(255,255,255,0.25); }
.pgr-footer-langs { display: flex; gap: 6px; }
.pgr-footer-lang {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    cursor: pointer;
}
.pgr-footer-lang:hover,
.pgr-footer-lang.active {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.88);
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .pgr-footer-top { grid-template-columns: 1fr 1fr 1fr; }
    .pgr-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .pgr-header-nav { display: none; }
    .pgr-mobile-menu-btn { display: flex; }
    .pht-left { display: none; }
    .phm-search { max-width: none; }
    .pgr-header-main { height: 60px; }
}

@media (max-width: 640px) {
    .pgr-header-top { display: none; }
    .pgr-footer-top { grid-template-columns: 1fr 1fr; }
    .pgr-footer-brand { grid-column: 1 / -1; }
    .pgr-footer-bottom { flex-direction: column; align-items: flex-start; }
    .pgr-header-inner,
    .pgr-footer-inner,
    .pgr-nav-inner { padding: 0 18px; }
}

@media (max-width: 400px) {
    .pgr-footer-top { grid-template-columns: 1fr; }
}
