/* =====================================================
   MEDIFACE HEALTH CARE — Global Stylesheet (style.css)
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --teal: #0a7b6c; --teal2: #12a08e; --teal3: #065a4f; --teal4: #e8f5f2;
  --gold: #c8a96e; --gold2: #f0d898;
  --dark: #0f1923; --dark2: #1e2d3d;
  --gray: #64748b; --lgray: #f1f5f4; --border: #e5eae9;
  --white: #fff; --cream: #faf8f4;
  --red: #e53e3e; --orange: #dd6b20; --blue: #3182ce;
  --fh: 'Playfair Display', Georgia, serif;
  --fb: 'DM Sans', sans-serif;
  --nav-h: 68px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--fb); background: var(--cream); color: var(--dark); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ── SHARED NAV ── */
.mf-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%; background: rgba(255,255,255,0.97); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(10,123,108,0.1);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06); transition: box-shadow .3s;
}
.mf-nav.scrolled { box-shadow: 0 4px 28px rgba(0,0,0,0.11); }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo-img { height: 44px; width: auto; object-fit: contain; }
.nav-logo-text strong { display: block; font-family: var(--fh); font-size: 16px; color: var(--teal3); font-weight: 700; line-height: 1.1; }
.nav-logo-text span { font-size: 10px; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a { font-size: 13.5px; font-weight: 500; color: var(--dark2); border-bottom: 2px solid transparent; padding-bottom: 2px; transition: all .25s; }
.nav-links a:hover, .nav-links a.active { color: var(--teal); border-bottom-color: var(--teal); }
.nav-cart-btn { position: relative; background: var(--teal4); border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 18px; transition: all .25s; }
.nav-cart-btn:hover { background: var(--teal); }
.cart-count { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--fb); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--teal); margin: 5px 0; transition: .3s; }
.mobile-nav { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px 20px 20px; box-shadow: 0 8px 28px rgba(0,0,0,.1); z-index: 899; }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 12px 0; font-size: 15px; font-weight: 500; color: var(--dark2); border-bottom: 1px solid var(--lgray); }

/* ── PAGE HERO BANNER ── */
.page-hero {
  padding: calc(var(--nav-h) + 60px) 5% 60px;
  background: linear-gradient(150deg, #eaf6f3 0%, #f5faf8 50%, #fdf9f2 100%);
  text-align: center; position: relative; overflow: hidden;
}
.page-hero::before { content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%; background: var(--teal); opacity: .05; top: -150px; right: -100px; }
.page-hero-tag { display: inline-block; background: rgba(10,123,108,.09); color: var(--teal); padding: 5px 14px; border-radius: 50px; font-size: 11.5px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px; }
.page-hero h1 { font-family: var(--fh); font-size: clamp(28px, 4vw, 50px); color: var(--dark); font-weight: 700; margin-bottom: 12px; }
.page-hero p { color: var(--gray); font-size: 16px; max-width: 540px; margin: 0 auto; line-height: 1.75; }

/* ── SECTION ── */
.sec { padding: 70px 5%; max-width: 1280px; margin: 0 auto; }
.sec-head { text-align: center; margin-bottom: 50px; }
.sec-tag { display: inline-block; background: rgba(10,123,108,.08); color: var(--teal); padding: 5px 14px; border-radius: 50px; font-size: 11.5px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; }
.sec-title { font-family: var(--fh); font-size: clamp(26px, 3.5vw, 44px); color: var(--dark); font-weight: 700; line-height: 1.2; margin-bottom: 12px; }
.sec-sub { color: var(--gray); font-size: 15px; max-width: 500px; margin: 0 auto; line-height: 1.75; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 22px; border-radius: 50px; border: none; cursor: pointer; font-size: 13.5px; font-family: var(--fb); font-weight: 500; transition: all .25s; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal3); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(10,123,108,.3); }
.btn-outline { border: 2px solid var(--teal); color: var(--teal); background: transparent; }
.btn-outline:hover { background: var(--teal); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a8893a; }
.btn-danger { background: rgba(229,62,62,.1); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: 12.5px; }
.btn-lg { padding: 14px 32px; font-size: 15px; }

/* ── CARDS ── */
.card { background: #fff; border-radius: 16px; box-shadow: 0 3px 16px rgba(0,0,0,.06); border: 1px solid rgba(0,0,0,.04); overflow: hidden; }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--lgray); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { font-family: var(--fh); font-size: 19px; color: var(--dark); }
.card-body { padding: 22px; }

/* ── GRID HELPERS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 24px; }

/* ── FORM ── */
.fg { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fg label { font-size: 11.5px; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: .5px; }
.fg input, .fg select, .fg textarea {
  padding: 11px 13px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: var(--fb); color: var(--dark); outline: none;
  transition: border .25s, box-shadow .25s; background: #fff;
}
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(10,123,108,.08); }
.fg textarea { resize: vertical; min-height: 80px; }
.fg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 50px; font-size: 11px; font-weight: 600; }
.badge-teal { background: rgba(10,123,108,.1); color: var(--teal); }
.badge-gold { background: rgba(200,169,110,.15); color: #a07840; }
.badge-red  { background: rgba(229,62,62,.1); color: var(--red); }
.badge-blue { background: rgba(49,130,206,.1); color: var(--blue); }

/* ── TABLE ── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f8f9fa; padding: 11px 14px; text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gray); font-weight: 600; border-bottom: 1px solid var(--border); }
td { padding: 13px 14px; font-size: 13.5px; border-bottom: 1px solid #f8f8f8; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fcfcfc; }
.td-img { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: var(--teal4); padding: 3px; }
.td-acts { display: flex; gap: 7px; }

/* ── MODAL ── */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,25,35,.6); z-index: 1000; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(5px); }
.modal-backdrop.open { display: flex; }
.modal-box { background: #fff; border-radius: 20px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; padding: 32px; position: relative; animation: mIn .3s ease; }
.modal-box.lg { max-width: 860px; }
@keyframes mIn { from { opacity:0; transform: scale(.95); } to { opacity:1; transform: scale(1); } }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--lgray); border: none; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: .2s; }
.modal-close:hover { background: #ddd; }
.modal-title { font-family: var(--fh); font-size: 22px; color: var(--dark); margin-bottom: 22px; font-weight: 600; }

/* ── IMAGE UPLOAD AREA ── */
.img-upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; transition: all .25s; position: relative; overflow: hidden; }
.img-upload-area:hover { border-color: var(--teal); background: var(--teal4); }
.img-upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-upload-area p { color: var(--gray); font-size: 13px; margin-top: 8px; }
.img-upload-area .ico { font-size: 32px; }
.img-preview { max-width: 100%; max-height: 120px; border-radius: 8px; margin: 10px auto 0; object-fit: contain; display: none; }

/* ── TOAST ── */
#toast { position: fixed; bottom: 22px; right: 22px; background: var(--teal); color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 14px; z-index: 9999; transform: translateY(70px); opacity: 0; transition: all .35s; box-shadow: 0 8px 24px rgba(0,0,0,.18); pointer-events: none; }
#toast.show { transform: translateY(0); opacity: 1; }
#toast.err { background: var(--red); }

/* ── FOOTER ── */
.mf-footer { background: var(--dark); color: #fff; padding: 56px 5% 26px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 44px; margin-bottom: 44px; }
.footer-brand p { color: rgba(255,255,255,.45); font-size: 13.5px; line-height: 1.85; margin-top: 12px; max-width: 260px; }
.footer-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); margin-bottom: 16px; font-weight: 600; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col ul li a { color: rgba(255,255,255,.48); font-size: 13.5px; transition: color .25s; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { max-width: 1200px; margin: 0 auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; }
.footer-bottom p { color: rgba(255,255,255,.3); font-size: 12.5px; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--gray); }
.empty-state .ico { font-size: 52px; margin-bottom: 14px; }
.empty-state p { font-size: 15px; }

/* ── RESPONSIVE ── */
@media(max-width:1024px){ .grid-4{grid-template-columns:repeat(2,1fr);} .footer-inner{grid-template-columns:1fr 1fr;} }
@media(max-width:768px){
  .nav-links,.nav-cart-btn{ display:none; }
  .nav-toggle{ display:block; }
  .grid-2,.grid-3,.footer-inner{ grid-template-columns:1fr; }
  .grid-4{ grid-template-columns:repeat(2,1fr); }
  .fg-row{ grid-template-columns:1fr; }
  .footer-bottom{ flex-direction:column; gap:6px; text-align:center; }
}
@media(max-width:480px){ .grid-4{grid-template-columns:1fr;} }
