/* ================================================================
   SUNSHINE SKINCARE — Master Stylesheet
   Brand Colors: Castleton Green + Copper Penny + White
   
   HOW TO READ THIS FILE:
   Each section is labeled. To change a color, find the variable
   in :root and update the hex code. To change spacing or size,
   find the relevant section and update px/rem values.
   ================================================================ */


/* ── 1. CSS VARIABLES (Your Brand Colors & Reusable Values)
   These are like named shortcuts. Change a value here and it
   updates everywhere on the site automatically.
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box; /* Makes width/height calculations predictable */
  margin: 0;
  padding: 0;
}

:root {
  /* BRAND COLORS — change these hex codes to restyle the whole site */
  --green:        #1a3a2a;   /* Dark Castleton Green — main brand color */
  --green-mid:    #2d5a3d;   /* Medium green — used for hover states */
  --green-light:  #e8f0eb;   /* Very light green — used for backgrounds */
  --copper:       #b87355;   /* Copper Penny — accent color */
  --copper-light: #d4956f;   /* Lighter copper — used for hover states */
  --copper-pale:  #f5ede6;   /* Very pale copper — used for section backgrounds */
  --white:        #fdfcf9;   /* Off-white — main background color */

  /* TEXT COLORS */
  --text-dark:    #1a1a18;   /* Almost black — main body text */
  --text-mid:     #4a4a44;   /* Dark grey — secondary text */
  --text-muted:   #8a8a80;   /* Light grey — captions, hints */

  /* BORDERS */
  --border: rgba(26,58,42,0.12); /* Subtle green-tinted border */

  /* ACCENT */
  --gold: #E8A020; /* Logo sun ray color */
}

html {
  scroll-behavior: smooth; /* Smooth scrolling when clicking anchor links */
}

/* BASE BODY STYLES
   font-size: 15px = base text size (increase to 16px for larger text)
   line-height: 1.7 = space between lines (increase for more breathing room) */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.7;
}


/* ── 2. NAVIGATION BAR
   height: 68px = how tall the nav bar is
   padding: 0 48px = space on left and right sides of nav
   position: sticky = keeps nav at top when scrolling
   ---------------------------------------------------------------- */
nav {
  position: sticky;
  top: 0;
  z-index: 100; /* Keeps nav on top of all other elements */
  background: var(--white);
  border-bottom: 0.5px solid var(--border);
  padding: 0 48px;       /* LEFT/RIGHT padding — increase for more side space */
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;          /* NAV HEIGHT — change this to make nav taller/shorter */
}

/* Navigation links (the menu items) */
.nav-links {
  display: flex;
  gap: 36px;             /* SPACE BETWEEN NAV LINKS — increase for more gap */
  list-style: none;
}

.nav-links a {
  font-size: 13px;       /* NAV LINK TEXT SIZE */
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--copper); }

/* "Shop Now" button in the nav */
.nav-cta {
  background: var(--green);
  color: var(--white) !important;
  padding: 9px 22px;     /* TOP/BOTTOM and LEFT/RIGHT padding of button */
  border-radius: 2px;    /* Roundness of button corners — increase for rounder */
  font-size: 12px !important;
  letter-spacing: 0.1em !important;
  text-decoration: none;
  transition: background 0.2s;
}

.nav-cta:hover { background: var(--green-mid) !important; }


/* ── 3. FOOTER
   padding: 60px 64px 32px = TOP, LEFT/RIGHT, BOTTOM spacing
   ---------------------------------------------------------------- */
footer {
  background: var(--green);
  color: rgba(255,255,255,0.6);
  padding: 60px 64px 32px; /* TOP LEFT/RIGHT BOTTOM — adjust spacing here */
}

/* Footer 3-column grid layout
   grid-template-columns: 2fr 1fr 1fr = first col is twice as wide */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;             /* GAP BETWEEN FOOTER COLUMNS */
  margin-bottom: 48px;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.8;
  max-width: 280px;      /* MAX WIDTH of footer description text */
  margin-bottom: 24px;
}

.footer-contact a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.footer-contact a:hover { color: var(--copper-light); }

.footer-heading {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 20px;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--copper-light); }

/* Footer bottom bar (copyright + order button) */
.footer-bottom {
  border-top: 0.5px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}


/* ── 4. BUTTONS
   padding: controls the size of the button (TOP/BOTTOM LEFT/RIGHT)
   border-radius: controls how round the corners are
   ---------------------------------------------------------------- */

/* Primary filled button (copper background) */
.btn-primary {
  background: var(--copper);
  color: var(--white);
  padding: 14px 32px;    /* BUTTON SIZE — increase numbers for bigger button */
  border-radius: 2px;    /* CORNER ROUNDNESS — use 20px for pill shape */
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--copper-light); }

/* WhatsApp order button */
.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--copper);
  color: var(--white);
  padding: 11px 24px;    /* BUTTON SIZE */
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s;
}
.wa-btn:hover { background: var(--copper-light); }


/* ── 5. TYPOGRAPHY (Headings and Labels)
   font-size: controls text size in pixels
   letter-spacing: controls space between letters
   font-weight: 300=light, 400=normal, 600=bold
   ---------------------------------------------------------------- */

/* Small uppercase label above sections (e.g. "Who We Are") */
.section-label {
  font-size: 11px;       /* LABEL TEXT SIZE */
  letter-spacing: 0.18em; /* LETTER SPACING — increase for more spread */
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 12px;
}

/* Large section heading (uses Cormorant Garamond serif font) */
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px;       /* HEADING SIZE — decrease for smaller headings */
  font-weight: 300;      /* HEADING WEIGHT — 300=thin, 600=bold */
  color: var(--green);
  line-height: 1.2;      /* LINE HEIGHT — increase for more space between lines */
  margin-bottom: 20px;
}
.section-title em { font-style: italic; } /* italic words inside headings */


/* ── 6. FILTER BAR (Category filter buttons on products/blog pages)
   ---------------------------------------------------------------- */
.filter-bar {
  display: flex;
  gap: 8px;              /* GAP BETWEEN FILTER BUTTONS */
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding-bottom: 20px;
  border-bottom: 0.5px solid var(--border);
}

.filter-btn {
  background: none;
  border: 0.5px solid var(--border);
  color: var(--text-muted);
  padding: 8px 20px;     /* FILTER BUTTON SIZE */
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.filter-btn:hover { border-color: var(--copper); color: var(--copper); }
.filter-btn.active { background: var(--green); color: var(--white); border-color: var(--green); }


/* ── 7. LANGUAGE TOGGLE (EN | FR | RW switcher in the nav)
   ---------------------------------------------------------------- */
.lang-toggle {
  display: flex;
  gap: 0;
  align-items: center;
  border: 0.5px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-left: 16px;     /* SPACE FROM OTHER NAV ITEMS — increase to push right */
}

.lang-btn {
  background: none;
  border: none;
  border-right: 0.5px solid var(--border);
  padding: 5px 10px;     /* LANGUAGE BUTTON SIZE */
  font-size: 11px;       /* LANGUAGE BUTTON TEXT SIZE */
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}
.lang-btn:last-child { border-right: none; }
.lang-btn:hover { background: var(--green-light); color: var(--green); }
.lang-btn.active { background: var(--green); color: var(--white); }


/* ── 8. SEARCH BAR
   ---------------------------------------------------------------- */

/* The container that wraps the search input and results */
.search-container {
  position: relative;    /* Needed so results dropdown positions correctly */
  margin: 0 16px;        /* SPACE AROUND SEARCH BAR — adjust as needed */
}

/* The search input field */
.search-input {
  width: 220px;          /* SEARCH BAR WIDTH — increase to make it wider */
  background: var(--green-light);
  border: 0.5px solid var(--border);
  border-radius: 20px;   /* ROUNDNESS — 20px gives pill shape */
  padding: 7px 16px 7px 36px; /* TOP RIGHT BOTTOM LEFT — left padding leaves room for icon */
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  outline: none;
  transition: all 0.2s;
}
.search-input:focus {
  width: 280px;          /* WIDTH WHEN FOCUSED/ACTIVE — expands on click */
  border-color: var(--copper);
  background: var(--white);
}
.search-input::placeholder { color: var(--text-muted); }

/* Search icon inside the input */
.search-icon {
  position: absolute;
  left: 12px;            /* ICON POSITION FROM LEFT EDGE */
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;  /* Click passes through icon to input below */
}

/* Results dropdown panel */
.search-results {
  display: none;         /* Hidden by default, shown by JS when there are results */
  position: absolute;
  top: calc(100% + 8px); /* GAP BETWEEN INPUT AND RESULTS — change 8px */
  left: 0;
  right: 0;
  min-width: 340px;      /* MINIMUM WIDTH OF RESULTS PANEL */
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(26,58,42,0.12);
  z-index: 200;
  overflow: hidden;
  max-height: 420px;     /* MAX HEIGHT before results scroll — change as needed */
  overflow-y: auto;
}

/* Section label inside results (e.g. "Products", "Blog Articles") */
.sr-group-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 16px 6px;
  background: var(--green-light);
}

/* Individual search result row */
.sr-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;    /* TOP/BOTTOM and LEFT/RIGHT padding of each result */
  text-decoration: none;
  transition: background 0.15s;
  border-bottom: 0.5px solid var(--border);
  color: inherit;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--green-light); }

/* Colored square icon before each result (P = Product, B = Blog) */
.sr-item-icon {
  width: 32px;           /* ICON SIZE */
  height: 32px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--white);
}
.sr-product { background: var(--green); }   /* Green icon for products */
.sr-blog    { background: var(--copper); }  /* Copper icon for blog posts */

.sr-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 2px;
  line-height: 1.3;
}

/* Highlighted matching text in results */
.sr-item-title mark {
  background: rgba(184,115,85,0.2); /* HIGHLIGHT COLOR — change rgba values */
  color: var(--copper);
  border-radius: 2px;
  padding: 0 2px;
}

.sr-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* "Order" button inside product search results */
.sr-wa {
  margin-left: auto;
  background: var(--green);
  color: var(--white);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.2s;
}
.sr-wa:hover { background: var(--green-mid); }

/* "No results" message */
.sr-empty {
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}


/* ── 9. ADMIN PANEL STYLES
   ---------------------------------------------------------------- */
.admin-wrap {
  max-width: 820px;       /* MAX WIDTH of admin panel content */
  margin: 0 auto;
  padding: 48px 32px;     /* TOP/BOTTOM and LEFT/RIGHT page padding */
}

.admin-hero {
  background: var(--green);
  padding: 40px 48px;    /* HERO SECTION PADDING */
  margin-bottom: 40px;
  border-radius: 6px;
}
.admin-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;       /* ADMIN PANEL TITLE SIZE */
  font-weight: 300;
  color: var(--white);
  margin-bottom: 6px;
}
.admin-hero p { font-size: 14px; color: rgba(255,255,255,0.6); }

/* Tab buttons at top of admin (Products / Blog Posts / Settings) */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  border-bottom: 0.5px solid var(--border);
}
.admin-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 20px;    /* TAB BUTTON SIZE */
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--copper); }
.admin-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 500; }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* White content card sections inside admin */
.admin-section {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 28px;          /* INNER PADDING of each admin section card */
  margin-bottom: 24px;    /* GAP BETWEEN SECTION CARDS */
}
.admin-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 300;
  color: var(--green);
  margin-bottom: 6px;
}
.admin-section p.hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* 2-column form grid inside admin */
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2 equal columns — change to 1fr for single col */
  gap: 16px;              /* GAP BETWEEN FORM FIELDS */
  margin-bottom: 16px;
}
.admin-form-group { display: flex; flex-direction: column; gap: 6px; }
.admin-form-group.full { grid-column: 1 / -1; } /* Full width field */
.admin-form-group label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 3px;
  padding: 10px 14px;    /* INPUT FIELD INNER PADDING */
  font-size: 14px;       /* INPUT TEXT SIZE */
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus { border-color: var(--copper); }
.admin-form-group textarea {
  resize: vertical;
  min-height: 100px;     /* MINIMUM HEIGHT OF TEXTAREA — increase for more room */
}

/* Admin action buttons */
.admin-btn {
  background: var(--green);
  color: var(--white);
  border: none;
  padding: 11px 28px;    /* ADMIN BUTTON SIZE */
  border-radius: 3px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.2s;
}
.admin-btn:hover { background: var(--green-mid); }
.admin-btn.copper { background: var(--copper); }
.admin-btn.copper:hover { background: var(--copper-light); }
.admin-btn.danger { background: #c0392b; }
.admin-btn.danger:hover { background: #a93226; }

/* List of existing items (products/posts) in admin */
.items-list { margin-top: 24px; border-top: 0.5px solid var(--border); padding-top: 20px; }
.items-list h3 { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }

/* Single item row in the list */
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;    /* ROW INNER PADDING */
  border: 0.5px solid var(--border);
  border-radius: 4px;
  margin-bottom: 8px;    /* GAP BETWEEN ROWS */
  background: var(--white);
}
.item-row:hover { border-color: rgba(184,115,85,0.3); }
.item-info { flex: 1; }
.item-name { font-size: 14px; font-weight: 500; color: var(--text-dark); margin-bottom: 2px; }
.item-meta { font-size: 12px; color: var(--text-muted); }
.item-actions { display: flex; gap: 8px; }
.item-btn {
  background: none;
  border: 0.5px solid var(--border);
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
  color: var(--text-muted);
}
.item-btn:hover { border-color: var(--copper); color: var(--copper); }
.item-btn.del:hover { border-color: #c0392b; color: #c0392b; }

/* Toast notification (success/error popup at bottom right) */
.toast {
  position: fixed;
  bottom: 32px;           /* DISTANCE FROM BOTTOM OF SCREEN */
  right: 32px;            /* DISTANCE FROM RIGHT OF SCREEN */
  background: var(--green);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s;
  pointer-events: none;
  z-index: 9999;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Login screen */
.login-wrap { max-width: 400px; margin: 80px auto; padding: 0 24px; }
.login-card { border: 0.5px solid var(--border); border-radius: 6px; padding: 40px 36px; text-align: center; }
.login-card h2 { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 300; color: var(--green); margin-bottom: 6px; }
.login-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.login-input { width: 100%; border: 0.5px solid var(--border); border-radius: 3px; padding: 12px 14px; font-size: 14px; font-family: 'DM Sans', sans-serif; outline: none; margin-bottom: 12px; transition: border-color 0.2s; }
.login-input:focus { border-color: var(--copper); }
.login-error { font-size: 13px; color: #c0392b; margin-bottom: 12px; display: none; }


/* ── 10. RESPONSIVE — MOBILE ADJUSTMENTS
   These rules apply only on screens narrower than the given width.
   max-width: 900px = tablets and large phones
   max-width: 600px = small phones
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  nav { padding: 0 24px; }  /* Less side padding on mobile */
  .nav-links { display: none; } /* Hide desktop menu on mobile */
  footer { padding: 40px 24px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; } /* Stack footer columns */
  .search-input { width: 160px; }
  .search-input:focus { width: 200px; }
}

@media (max-width: 600px) {
  .admin-form-grid { grid-template-columns: 1fr; } /* Stack admin form to single col */
  .admin-wrap { padding: 32px 18px; }
  .search-container { display: none; } /* Hide search on very small screens */
}
