/* =====================================================
   Taco Casa Nutrition Calculator — Plugin Stylesheet
   All rules scoped under .tcnc-wrap to avoid conflicts
   with the active WordPress theme.
   ===================================================== */

/* ── CSS CUSTOM PROPERTIES (scoped) ── */
.tcnc-wrap {
  --red:        #C8151B;
  --red-dark:   #A01015;
  --red-glow:   rgba(200,21,27,0.25);
  --gold:       #F5C518;
  --gold-dim:   #D4A800;
  --gold-glow:  rgba(245,197,24,0.20);
  --bg:         #0D0D0D;
  --card:       #1A1A1A;
  --card-hi:    #222222;
  --elevated:   #2A2A2A;
  --border:     #2E2E2E;
  --border-hi:  #3D3D3D;
  --text:       #FFFFFF;
  --text-muted: #A0A0A0;
  --text-dim:   #666666;
  --green:      #22A05B;
  --shadow:     rgba(0,0,0,0.5);

  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}

.tcnc-wrap *,
.tcnc-wrap *::before,
.tcnc-wrap *::after {
  box-sizing: border-box;
}

/* ── HEADER ── */
.tcnc-wrap .tc-header {
  background: #111111;
  border-bottom: 3px solid var(--red);
  padding: 28px 24px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tcnc-wrap .tc-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,21,27,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.tcnc-wrap .tc-logo-line {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 8vw, 68px);
  color: var(--gold);
  letter-spacing: 6px;
  line-height: 1;
  position: relative;
  text-shadow: 0 2px 20px rgba(245,197,24,0.35);
  margin: 0;
}
.tcnc-wrap .tc-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 7px;
  position: relative;
}
.tcnc-wrap .tc-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  margin-top: 12px;
  position: relative;
  box-shadow: 0 4px 14px var(--red-glow);
}

/* ── LAYOUT ── */
.tcnc-wrap .tc-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ── INSTRUCTION BAR ── */
.tcnc-wrap .tc-instructions {
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── TWO-COLUMN ── */
.tcnc-wrap .tc-columns {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  margin-top: 28px;
}
@media (max-width: 800px) {
  .tcnc-wrap .tc-columns { grid-template-columns: 1fr; }
}

/* ── CATEGORY TABS ── */
.tcnc-wrap .tc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tcnc-wrap .tc-tab {
  padding: 8px 18px;
  border: 1.5px solid var(--border-hi);
  background: var(--card);
  border-radius: 40px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
}
.tcnc-wrap .tc-tab:hover { border-color: var(--gold-dim); color: var(--gold); }
.tcnc-wrap .tc-tab.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 16px var(--red-glow);
}

/* ── MENU SECTION ── */
.tcnc-wrap .tc-section { display: none; }
.tcnc-wrap .tc-section.visible { display: block; }

.tcnc-wrap .tc-section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--gold);
  letter-spacing: 3px;
  border-left: 4px solid var(--red);
  padding-left: 14px;
  margin-bottom: 14px;
  margin-top: 0;
}

/* ── ITEM CARDS ── */
.tcnc-wrap .tc-items { display: flex; flex-direction: column; gap: 8px; }

.tcnc-wrap .tc-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.tcnc-wrap .tc-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.2s;
}
.tcnc-wrap .tc-item:hover {
  border-color: var(--red);
  background: var(--card-hi);
  box-shadow: 0 4px 20px var(--red-glow);
}
.tcnc-wrap .tc-item:hover::before { background: var(--red); }

.tcnc-wrap .tc-item-emoji { font-size: 24px; flex-shrink: 0; width: 38px; text-align: center; }

.tcnc-wrap .tc-item-info { flex: 1; min-width: 0; }
.tcnc-wrap .tc-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tcnc-wrap .tc-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tcnc-wrap .tc-item-meta span { display: flex; align-items: center; gap: 3px; }

.tcnc-wrap .tc-item-cal {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--red);
  white-space: nowrap;
}
.tcnc-wrap .tc-item-cal small {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

.tcnc-wrap .tc-item-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.tcnc-wrap .tc-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.tcnc-wrap .tc-qty-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hi);
  background: var(--elevated);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: 'DM Sans', sans-serif;
}
.tcnc-wrap .tc-qty-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 2px 10px var(--red-glow);
}
.tcnc-wrap .tc-qty-num {
  font-weight: 700;
  font-size: 16px;
  width: 24px;
  text-align: center;
  color: var(--text);
}

/* ── PANEL ── */
.tcnc-wrap .tc-panel {
  position: sticky;
  top: 20px;
  height: fit-content;
}

.tcnc-wrap .tc-summary-card {
  background: #111111;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  color: var(--text);
  box-shadow: 0 16px 50px rgba(0,0,0,0.6);
}

.tcnc-wrap .tc-sum-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 2px;
}
.tcnc-wrap .tc-sum-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.tcnc-wrap .tc-big-cal {
  text-align: center;
  padding: 20px 0 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 14px 0;
}
.tcnc-wrap .tc-big-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 76px;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 40px var(--gold-glow);
}
.tcnc-wrap .tc-big-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* DV bar */
.tcnc-wrap .tc-dv-bar-wrap { margin: 14px 0 6px; }
.tcnc-wrap .tc-dv-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.tcnc-wrap .tc-dv-track {
  background: var(--elevated);
  border-radius: 4px;
  height: 7px;
  overflow: hidden;
}
.tcnc-wrap .tc-dv-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.tcnc-wrap .tc-dv-fill.green { background: var(--green); }
.tcnc-wrap .tc-dv-fill.yellow { background: var(--gold); }
.tcnc-wrap .tc-dv-fill.red { background: var(--red); }

/* Macro grid */
.tcnc-wrap .tc-macros {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}
.tcnc-wrap .tc-macro-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.tcnc-wrap .tc-macro-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--text);
  line-height: 1;
}
.tcnc-wrap .tc-macro-unit { font-size: 11px; color: var(--text-dim); }
.tcnc-wrap .tc-macro-name { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Nutrients detail */
.tcnc-wrap .tc-nutrients { margin-top: 14px; }
.tcnc-wrap .tc-nut-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tcnc-wrap .tc-nut-row:last-child { border-bottom: none; }
.tcnc-wrap .tc-nut-name { color: var(--text-muted); }
.tcnc-wrap .tc-nut-val { color: var(--text); font-weight: 600; }

/* Price total */
.tcnc-wrap .tc-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(245,197,24,0.08);
  border: 1px solid rgba(245,197,24,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 14px;
}
.tcnc-wrap .tc-price-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.tcnc-wrap .tc-price-val {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  color: var(--gold);
}

/* Cart items list */
.tcnc-wrap .tc-cart-section { margin-top: 16px; }
.tcnc-wrap .tc-cart-title {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.tcnc-wrap .tc-cart-list { max-height: 160px; overflow-y: auto; }
.tcnc-wrap .tc-cart-list::-webkit-scrollbar { width: 3px; }
.tcnc-wrap .tc-cart-list::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }
.tcnc-wrap .tc-cart-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.tcnc-wrap .tc-cart-item-name {
  color: var(--text-muted);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tcnc-wrap .tc-cart-item-cal { color: var(--gold); font-weight: 700; white-space: nowrap; }
.tcnc-wrap .tc-empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 13px;
}
.tcnc-wrap .tc-empty-icon { font-size: 34px; margin-bottom: 8px; }

/* Buttons */
.tcnc-wrap .tc-btn-row { display: flex; gap: 10px; margin-top: 16px; }
.tcnc-wrap .tc-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tcnc-wrap .tc-btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 14px var(--red-glow);
}
.tcnc-wrap .tc-btn-primary:hover { background: var(--red-dark); box-shadow: 0 6px 20px var(--red-glow); }
.tcnc-wrap .tc-btn-secondary {
  background: var(--elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-hi);
}
.tcnc-wrap .tc-btn-secondary:hover { background: var(--card-hi); color: var(--text); }

/* Screenshot overlay — fixed, outside .tcnc-wrap scope intentionally */
.tcnc-screenshot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
  overflow-y: auto;
}
.tcnc-screenshot-overlay.show { display: flex; }
.tcnc-screenshot-modal {
  background: #111111;
  border: 1px solid #3D3D3D;
  border-radius: 16px;
  padding: 22px 20px 20px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  color: #FFFFFF;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: auto;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  font-family: 'DM Sans', sans-serif;
}
.tcnc-screenshot-modal h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: #F5C518;
  letter-spacing: 3px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.tcnc-screenshot-modal p {
  font-size: 12px;
  color: #666666;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.tcnc-preview-wrap {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid #3D3D3D;
}
#tcnc-screenshot-preview {
  width: 100%;
  display: block;
  border-radius: 8px;
}
.tcnc-screenshot-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding-top: 4px;
}
.tcnc-dl-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  min-width: 120px;
}
.tcnc-dl-btn.primary { background: #C8151B; color: #fff; box-shadow: 0 4px 16px rgba(200,21,27,0.25); }
.tcnc-dl-btn.primary:hover { background: #A01015; }
.tcnc-dl-btn.close { background: #2A2A2A; color: #A0A0A0; border: 1px solid #3D3D3D; }
.tcnc-dl-btn.close:hover { background: #222222; color: #FFFFFF; }

/* Footer note */
.tcnc-wrap .tc-footnote {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Loading spinner */
.tcnc-wrap .tc-loading {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 13px;
}

/* DV badge colors */
.tcnc-wrap .badge-low  { color: var(--green); }
.tcnc-wrap .badge-med  { color: var(--gold); }
.tcnc-wrap .badge-high { color: var(--red); }
