/* =========================================================================
   CITY PHARMA - GLOBAL STYLESHEET
   Refactored from Ladipage to pure HTML/CSS optimized for Cloudflare Pages
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand Colors */
  --primary-color: #5990ff; /* Light Blue CTAs */
  --text-primary: #110a5c; /* Dark Blue Heading Text */
  --text-secondary: #000000;
  
  /* Gradient Backgrounds */
  --gradient-main: linear-gradient(135deg, rgb(153, 3, 227) 0%, rgb(56, 1, 82) 100%);
  --gradient-light: linear-gradient(135deg, #e0fcff 0%, #ffe0fc 100%);
  
  /* Brand additions */
  --header-bg: linear-gradient(90deg, rgb(56, 1, 82), rgb(153, 3, 227));
  --footer-bg: linear-gradient(90deg, rgb(56, 1, 82), rgb(153, 3, 227));
  
  /* UI Colors */
  --bg-white: #ffffff;
  --bg-gray: #f5f5f5;
  --border-color: #e0e0e0;
  
  /* Dimensions & Spacing */
  --header-height: 70px;
  --container-width: 1200px;
  --section-padding: 60px 20px;
  --radius-sm: 8px;
  --radius-md: 15px;
  --radius-full: 999px;
}

/* =========================================================================
   1. RESET & BASE
   ========================================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

body {
  background-color: var(--bg-gray);
  overflow-x: hidden;
  width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* Header Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* =========================================================================
   2. HEADER & NAVIGATION
   ========================================================================= */
.header {
  height: var(--header-height);
  background: var(--header-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  width: 100%;
}

.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
}

.logo-badge {
  background: var(--bg-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  position: relative; /* Anchor for verified badge */
}

.logo-badge img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

/* Header & Footer Size */
.logo-badge.small {
  width: 54px;
  height: 54px;
}

/* Hero Size */
.logo-badge.large {
  width: 110px;
  height: 110px;
  margin: 0 auto 20px;
}

.header-logo .logo-badge:hover {
  transform: scale(1.05);
}

.header-nav {
  display: flex;
  gap: 30px;
}

.header-nav a {
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  color: #fff;
  position: relative;
}

.header-nav a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.header-badges {
  display: flex;
  gap: 15px;
  align-items: center;
}

.badge-shopee {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #e31837;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  text-decoration: none;
  line-height: 1;
}

.badge-shopee:hover {
  background: #c41430;
  transform: translateY(-1px);
}

.badge-shopee svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
  vertical-align: middle;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  border-radius: 2px;
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--header-bg);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
  }
  .header-nav.open {
    display: flex;
  }
  .header-nav a {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .menu-toggle {
    display: flex;
  }
  .header-badges {
    display: none;
  }
}

/* =========================================================================
   3. COMPONENTS (Buttons, Badges, Animations)
   ========================================================================= */
.btn-cta {
  display: inline-block;
  background: linear-gradient(90deg, rgb(153, 3, 227) 0%, rgb(180, 20, 255) 50%, rgb(56, 1, 82) 100%);
  background-size: 200% auto;
  color: var(--bg-white);
  padding: 14px 40px;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
  box-shadow: 0 10px 20px rgba(111, 0, 255, 0.3);
  letter-spacing: 0.8px;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn-cta:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 15px 25px rgba(111, 0, 255, 0.4);
}


/* Section Separation Logistics (KNOWHOW.md 5.2) */

/* Section Separation Logistics (KNOWHOW.md 5.2) */
.hero {
  background: var(--gradient-light);
  padding: calc(var(--header-height) + 60px) 20px 80px;
  text-align: center;
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.hero h1, .hero h2, .hero h3 {
  color: var(--text-primary);
}

.hero-description {
  max-width: 600px;
  margin: 0 auto 30px;
  font-size: 1.1rem;
  opacity: 0.9;
  color: var(--text-secondary);
}

.features-section {
  background-color: var(--bg-gray);
  padding: 60px 20px;
  position: relative;
  z-index: 2;
}

/* Pop-In Animation (KNOWHOW.md 5.1) */
.check-badge {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Applying the spring pop-in animation */
  animation: checkPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  transform: scale(0.5);
}

.check-badge svg {
  width: 40px;
  height: 40px;
  fill: var(--bg-white);
}

@keyframes checkPopIn {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Success Check Badge Variant - Green (Bailleul Style) */
.check-badge.success {
  background: linear-gradient(135deg, #28a745, #20c997);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.check-badge.success svg {
  opacity: 0;
  animation: checkDraw 0.5s ease-out 0.4s forwards;
}

@keyframes checkDraw {
  from { opacity: 0; transform: scale(0.5) rotate(-30deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Mobile Padding Enforcement (KNOWHOW.md 5.3) */
@media (max-width: 768px) {
  .hero-description {
    padding: 0 20px;
  }
}

/* =========================================================================
   4. LOADING PAGE SPECIFICS
   ========================================================================= */
.loading-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-gray);
  padding: 20px;
}

.loading-logo img {
  width: 120px;
  margin-bottom: 40px;
  animation: pulseLogo 2s infinite ease-in-out;
}

@keyframes pulseLogo {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.qr-scan-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 30px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.loading-qr {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.8;
}

.qr-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
  box-shadow: 0 4px 10px var(--primary-color);
  animation: scanLine 2s infinite ease-in-out;
}

@keyframes scanLine {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  text-align: center;
}

.loading-subtext {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
}

/* =========================================================================
   5. FEATURE CARDS & PRODUCTS GRID (From Bailleul Layout)
   ========================================================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.feature-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
}

.feature-card-icon svg {
  width: 100%;
  height: 100%;
}

.feature-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0;
}

/* Bailleul Benefits Grid Style */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1000px;
  margin: 30px auto 0;
}

.benefit-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.benefit-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-top: 10px;
}

.benefit-card p {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.section-banner {
  display: block;
  max-width: 600px;
  margin: 0 auto 30px;
  background: var(--gradient-main);
  color: var(--bg-white);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  padding: 12px 32px;
  border-radius: var(--radius-full);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 10px;
}

.product-card-link {
  display: block;
  overflow: hidden;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.product-card-link:hover {
  transform: translateY(-4px);
}

.product-card-link img {
  width: 80%;
  height: auto;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}

/* =========================================================================
   6. FOOTER (Detailed Bailleul Layout)
   ========================================================================= */
.footer {
  background: var(--footer-bg);
  color: #fff;
  padding: 40px 0 0;
  margin-top: 40px;
}

.footer .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding-bottom: 30px;
  text-align: left;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

.footer-logo {
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-transform: uppercase;
}

.brand-name .verified,
.verified {
  width: 22px;
  height: 22px;
  background: #4a90d9;
  border-radius: 50%;
  border: 2px solid var(--bg-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.brand-name .verified svg,
.verified svg {
  width: 11px;
  height: 11px;
  fill: var(--bg-white);
}

/* Badge on Logo Positioning */
.logo-badge .verified {
  position: absolute;
  bottom: 5px;
  right: 5px;
  z-index: 5;
}

.logo-badge.large .verified {
  width: 24px;
  height: 24px;
  bottom: 6px;
  right: 6px;
}

.logo-badge.large .verified svg {
  width: 12px;
  height: 12px;
}

.logo-badge.small .verified {
  width: 18px;
  height: 18px;
  bottom: -2px;
  right: -2px;
}

.footer-brand-name {
  margin-top: 16px;
}

.footer-contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.footer-contact-list li svg {
  width: 16px;
  height: 16px;
  fill: var(--bg-white);
  flex-shrink: 0;
}

.footer-right h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 16px;
  margin-bottom: 16px;
  color: #fff;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.3s ease, color 0.3s ease;
}

.footer-links a:hover {
  color: var(--bg-white);
  transform: translateX(3px);
}

.footer-links a svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.3s ease;
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.footer-social a svg {
  width: 20px;
  height: 20px;
  fill: var(--bg-white);
}

.footer-bottom {
  text-align: center;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .footer .container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-links {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .products-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .section-banner {
    font-size: 13px;
    padding: 12px 16px;
    letter-spacing: 1px;
    width: 90%;
  }
}

/* =========================================================================
   6. LOADING PAGE (Ported from Bailleul)
   ========================================================================= */
.loading-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gradient-light);
  text-align: center;
  padding: 40px 20px;
}

.pulse-animation {
  background: var(--bg-white);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  margin-bottom: 40px;
  animation: pulseBrand 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseBrand {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(89, 144, 255, 0.1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(89, 144, 255, 0.3);
  }
}

.qr-scan-container {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 30px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.loading-qr {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.8;
}

.qr-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary-color);
  box-shadow: 0 4px 10px rgba(89, 144, 255, 0.6);
  animation: scan 2s infinite ease-in-out;
}

@keyframes scan {
  0% { top: 0; }
  50% { top: 100%; }
  100% { top: 0; }
}

.loading-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.loading-subtext {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}
