/* ===========================================================
   GTM Configurator v2 — Modern AI Server Configurator
   Pilot deploy: AS-5126GS-TNRT2 (others use legacy configurator.tpl)
   Last update: 2026-06-30
   =========================================================== */

#gtm-cfg2, #gtm-cfg2 * { box-sizing: border-box; }
#gtm-cfg2 { font-family: 'Lato', system-ui, sans-serif; color: #34495E; max-width: 1440px; margin: 0 auto; padding: 24px; }

/* HERO */
#gtm-cfg2 .cfg-hero { display: grid; grid-template-columns: 360px 1fr; gap: 32px; background: #fff; border-radius: 16px; padding: 32px; margin-bottom: 20px; border: 1px solid #e1eaf2; }
#gtm-cfg2 .cfg-hero-gallery { display: flex; flex-direction: column; gap: 12px; }
#gtm-cfg2 .gallery-main { aspect-ratio: 4/3; background: #f6f9fc; border-radius: 12px; padding: 16px; display: flex; align-items: center; justify-content: center; border: 1px solid #eef1f4; }
#gtm-cfg2 .gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; display: none; }
#gtm-cfg2 .gallery-main img.active { display: block; }
#gtm-cfg2 .gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
#gtm-cfg2 .gallery-thumb { width: 56px; height: 56px; padding: 4px; border: 1px solid #e1eaf2; border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .15s ease; }
#gtm-cfg2 .gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
#gtm-cfg2 .gallery-thumb.active { border-color: #003A70; }
#gtm-cfg2 .cfg-hero-info h1 { font-size: clamp(20px, 2.6vw, 26px); color: #003A70; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.3px; }
#gtm-cfg2 .cfg-subtitle-bar { background: linear-gradient(135deg, #003A70, #005a8a); color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 8px; margin-bottom: 14px; align-items: center; }
#gtm-cfg2 .cfg-subtitle-bar i { color: #76B900; }
#gtm-cfg2 .cfg-desc { font-size: 14px; line-height: 1.6; margin: 0 0 16px; color: #34495E; }
#gtm-cfg2 .cfg-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
#gtm-cfg2 .feat-item { display: flex; gap: 10px; padding: 10px 12px; background: #f6f9fc; border-radius: 8px; border: 1px solid #eef1f4; align-items: flex-start; }
#gtm-cfg2 .feat-item i { color: #76B900; font-size: 16px; margin-top: 2px; }
#gtm-cfg2 .feat-item span { font-size: 12.5px; color: #003A70; font-weight: 600; line-height: 1.4; }

/* SECTION TITLE */
#gtm-cfg2 .cfg-section-title { font-size: 13px; color: #5a6878; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 0 4px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
#gtm-cfg2 .cfg-section-title i { color: #76B900; }

/* CHASSIS TABS */
#gtm-cfg2 .cfg-tabs { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 20px; border: 1px solid #e1eaf2; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
#gtm-cfg2 .cfg-tab { background: #f6f9fc; border: 2px solid transparent; border-radius: 10px; padding: 14px 16px; cursor: pointer; transition: all .15s ease; text-align: left; display: flex; flex-direction: column; gap: 4px; }
#gtm-cfg2 .cfg-tab:hover { background: #eef4fb; }
#gtm-cfg2 .cfg-tab.active { background: linear-gradient(135deg, #003A70, #005a8a); border-color: #76B900; }
#gtm-cfg2 .cfg-tab-badge { display: inline-block; background: #76B900; color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: 1px; padding: 2px 8px; border-radius: 999px; align-self: flex-start; }
#gtm-cfg2 .cfg-tab.active .cfg-tab-badge { background: #e67e22; }
#gtm-cfg2 .cfg-tab-name { font-size: 13px; font-weight: 800; color: #003A70; line-height: 1.3; }
#gtm-cfg2 .cfg-tab.active .cfg-tab-name { color: #fff; }
#gtm-cfg2 .cfg-tab-sub { font-size: 11.5px; color: #5a6878; line-height: 1.4; }
#gtm-cfg2 .cfg-tab.active .cfg-tab-sub { color: rgba(255,255,255,.85); }
#gtm-cfg2 .cfg-tab-price { font-size: 11.5px; font-weight: 800; color: #76B900; }
#gtm-cfg2 .cfg-tab.active .cfg-tab-price { color: #b3e063; }

/* BUNDLE DETAILS PANEL */
#gtm-cfg2 .bundle-panel { background: #fff; border-radius: 14px; padding: 28px 32px; margin-bottom: 16px; border: 1px solid #e1eaf2; }
#gtm-cfg2 .bundle-panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 2px solid #76B900; }
#gtm-cfg2 .bundle-icon { width: 48px; height: 48px; border-radius: 12px; background: linear-gradient(135deg, #76B900, #5a9000); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
#gtm-cfg2 .bundle-head-text h2 { margin: 0 0 4px; font-size: 22px; color: #003A70; font-weight: 800; letter-spacing: -0.3px; }
#gtm-cfg2 .bundle-head-text .use-case { font-size: 13px; color: #5a6878; }
#gtm-cfg2 .bundle-included-label { font-size: 11.5px; color: #76B900; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
#gtm-cfg2 .bundle-components { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
#gtm-cfg2 .bundle-comp { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #f4f7fb; border-radius: 8px; border-left: 3px solid #76B900; }
#gtm-cfg2 .bundle-comp i { color: #003A70; font-size: 18px; width: 22px; text-align: center; }
#gtm-cfg2 .bundle-comp span { font-size: 13px; color: #003A70; font-weight: 600; line-height: 1.4; }

/* MAIN GRID */
#gtm-cfg2 .cfg-main { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
#gtm-cfg2 .cfg-cats { display: flex; flex-direction: column; gap: 16px; }

/* CATEGORY CARDS */
#gtm-cfg2 .cfg-cat { background: #fff; border-radius: 14px; border: 1px solid #e1eaf2; overflow: hidden; transition: border-color .15s ease; }
#gtm-cfg2 .cfg-cat.invalid { border-color: #f5b7b1; }
#gtm-cfg2 .cfg-cat-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: linear-gradient(135deg, #f4f8fc, #fff); border-bottom: 1px solid #e1eaf2; }
#gtm-cfg2 .cfg-cat.invalid .cfg-cat-head { background: linear-gradient(135deg, #fff5f5, #fff); }
#gtm-cfg2 .cat-icon { width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #003A70, #005a8a); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; }
#gtm-cfg2 .cat-info { flex: 1; }
#gtm-cfg2 .cat-info h3 { margin: 0; font-size: 15.5px; color: #003A70; font-weight: 800; }
#gtm-cfg2 .cat-meta { font-size: 11.5px; color: #5a6878; margin-top: 2px; }
#gtm-cfg2 .cat-status { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
#gtm-cfg2 .cat-status.empty { background: #fff4e6; color: #c05621; }
#gtm-cfg2 .cat-status.ok { background: #e7f5e7; color: #2f7a2f; }
#gtm-cfg2 .cat-status.error { background: #ffe6e6; color: #c53030; }
#gtm-cfg2 .cfg-cat-body { padding: 14px 22px 18px; }

/* OPTION GROUPS */
#gtm-cfg2 .opt-group { margin-bottom: 14px; }
#gtm-cfg2 .opt-group:last-child { margin-bottom: 0; }
#gtm-cfg2 .opt-group-head { font-size: 12px; color: #003A70; font-weight: 800; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid #eef1f4; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#gtm-cfg2 .opt-group-type-badge { font-size: 9.5px; color: #5a6878; background: #f4f7fb; padding: 2px 8px; border-radius: 999px; font-weight: 700; text-transform: uppercase; }

/* OPTION ROWS */
#gtm-cfg2 .opt-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; transition: background .12s ease; }
#gtm-cfg2 .opt-row:hover:not(.disabled) { background: #f4f7fb; }
#gtm-cfg2 .opt-row.selected { background: rgba(118,185,0,.06); border-color: rgba(118,185,0,.3); }
#gtm-cfg2 .opt-row.disabled { opacity: .45; cursor: not-allowed; }
#gtm-cfg2 .opt-row input { accent-color: #003A70; margin: 0; }
#gtm-cfg2 .opt-text { flex: 1; font-size: 12.5px; color: #34495E; line-height: 1.4; }
#gtm-cfg2 .opt-row.selected .opt-text { color: #003A70; font-weight: 700; }
#gtm-cfg2 .opt-price { font-size: 11.5px; color: #5a6878; font-weight: 700; white-space: nowrap; }
#gtm-cfg2 .opt-row.selected .opt-price { color: #76B900; }
#gtm-cfg2 .opt-qty-pill { font-size: 11.5px; color: #76B900; font-weight: 800; padding: 2px 8px; background: rgba(118,185,0,.1); border-radius: 999px; }

/* QTY CONTROL */
#gtm-cfg2 .opt-qty-control { display: flex; background: #fff; border: 1px solid #e1eaf2; border-radius: 6px; overflow: hidden; }
#gtm-cfg2 .opt-qty-control button { background: #f6f9fc; border: none; width: 28px; height: 28px; cursor: pointer; color: #003A70; font-weight: 800; font-size: 15px; }
#gtm-cfg2 .opt-qty-control button:hover:not(:disabled) { background: #003A70; color: #fff; }
#gtm-cfg2 .opt-qty-control button:disabled { opacity: .35; cursor: not-allowed; }
#gtm-cfg2 .opt-qty-control .qty-value { padding: 0 12px; font-weight: 800; color: #003A70; font-size: 13px; min-width: 34px; text-align: center; line-height: 28px; }

/* SUMMARY (sticky) */
#gtm-cfg2 .cfg-summary { position: sticky; top: 60px; background: #fff; border-radius: 14px; border: 1px solid #e1eaf2; padding: 22px; }
#gtm-cfg2 .cfg-summary-head { border-bottom: 1px solid #eef1f4; padding-bottom: 14px; margin-bottom: 14px; }
#gtm-cfg2 .cfg-summary-head h3 { font-size: 15px; color: #003A70; font-weight: 800; margin: 0 0 4px; }
#gtm-cfg2 .active-cfg { font-size: 11.5px; color: #5a6878; }
#gtm-cfg2 .active-cfg b { color: #003A70; }

/* CONFIG CODE BOX */
#gtm-cfg2 .cfg-code-box { background: linear-gradient(135deg, #003A70, #005a8a); color: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
#gtm-cfg2 .cfg-code-box .cc-label { font-size: 10px; opacity: .8; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
#gtm-cfg2 .cfg-code-box .cc-label i { color: #76B900; }
#gtm-cfg2 .cfg-code-row { display: flex; align-items: center; gap: 8px; }
#gtm-cfg2 .cfg-code-row .cc-value { flex: 1; font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 14.5px; font-weight: 700; letter-spacing: 1px; color: #76B900; }
#gtm-cfg2 .cfg-code-copy { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
#gtm-cfg2 .cfg-code-copy:hover { background: rgba(255,255,255,.22); }
#gtm-cfg2 .cfg-code-copy.copied { background: #76B900; border-color: #76B900; }

/* VALIDATION */
#gtm-cfg2 .validation-banner { background: #fff5f5; border: 1px solid #f5b7b1; border-left: 4px solid #c53030; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; font-size: 12px; color: #c53030; display: none; }
#gtm-cfg2 .validation-banner.active { display: block; }
#gtm-cfg2 .validation-banner b { display: block; margin-bottom: 4px; font-size: 12.5px; }
#gtm-cfg2 .validation-banner ul { margin: 4px 0 0; padding-left: 18px; }

/* SUMMARY LIST */
#gtm-cfg2 .cfg-summary-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; max-height: 320px; overflow-y: auto; }
#gtm-cfg2 .cfg-sum-row { padding: 8px 0; border-bottom: 1px solid #f4f7fb; }
#gtm-cfg2 .cfg-sum-row:last-child { border-bottom: 0; }
#gtm-cfg2 .cat-name-sum { font-size: 10.5px; color: #5a6878; font-weight: 700; text-transform: uppercase; margin-bottom: 2px; display: flex; justify-content: space-between; }
#gtm-cfg2 .cat-name-sum .cat-total { color: #76B900; font-weight: 800; }
#gtm-cfg2 .cat-name-sum.invalid .cat-total { color: #c53030; }
#gtm-cfg2 .opt-list-sum { font-size: 12.5px; color: #003A70; line-height: 1.5; }
#gtm-cfg2 .opt-list-sum .placeholder { color: #c0c8d2; font-style: italic; font-size: 11.5px; }
#gtm-cfg2 .opt-pill { display: inline-block; background: #f4f7fb; padding: 3px 9px; border-radius: 4px; margin: 2px 4px 2px 0; font-size: 11.5px; }
#gtm-cfg2 .opt-pill .qty { color: #76B900; font-weight: 800; margin-right: 4px; }

/* PRICE BOX */
#gtm-cfg2 .cfg-summary-price { background: linear-gradient(135deg, #003A70, #005a8a); color: #fff; border-radius: 10px; padding: 16px; margin-bottom: 14px; }
#gtm-cfg2 .cfg-summary-price .label { font-size: 11px; opacity: .8; text-transform: uppercase; margin-bottom: 2px; }
#gtm-cfg2 .cfg-summary-price .price { font-size: 26px; font-weight: 800; }
#gtm-cfg2 .cfg-summary-price .price small { font-size: 12px; opacity: .7; }
#gtm-cfg2 .cfg-summary-price .breakdown { font-size: 11px; opacity: .8; margin-top: 4px; }

/* CTA BUTTONS */
#gtm-cfg2 .cfg-cta-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 18px; background: #e67e22; color: #fff !important; border: none; border-radius: 10px; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 0 4px 12px rgba(230,126,34,.3); margin-bottom: 8px; text-decoration: none; }
#gtm-cfg2 .cfg-cta-primary:hover:not(:disabled) { background: #d47b10; transform: translateY(-1px); }
#gtm-cfg2 .cfg-cta-primary:disabled { background: #c0c8d2; cursor: not-allowed; box-shadow: none; }
#gtm-cfg2 .cfg-cta-share { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 18px; background: linear-gradient(135deg, #003A70, #005a8a); color: #fff !important; border: none; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; margin-bottom: 8px; box-shadow: 0 4px 12px rgba(0,58,112,.25); text-decoration: none; }
#gtm-cfg2 .cfg-cta-share:hover:not(:disabled) { background: linear-gradient(135deg, #002645, #003A70); transform: translateY(-1px); }
#gtm-cfg2 .cfg-cta-share:disabled { opacity: .6; cursor: wait; }
#gtm-cfg2 .cfg-cta-secondary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px 18px; background: #fff; color: #003A70 !important; border: 1px solid #e1eaf2; border-radius: 10px; font-weight: 700; font-size: 12.5px; cursor: pointer; text-decoration: none; }
#gtm-cfg2 .cfg-cta-secondary:hover { border-color: #003A70; background: #f6f9fc; }

/* RECOMMENDED BADGE */
#gtm-cfg2 .opt-row.recommended { background: linear-gradient(90deg, rgba(118,185,0,.04), transparent); }
#gtm-cfg2 .opt-row.recommended.selected { background: rgba(118,185,0,.1); }
#gtm-cfg2 .opt-recommended-badge { display: inline-flex; align-items: center; gap: 3px; background: #76B900; color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .5px; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; flex-shrink: 0; }
#gtm-cfg2 .opt-recommended-badge i { font-size: 8px; }

/* CHASSIS TAB BADGES (Gold/Custom/Bundle) */
#gtm-cfg2 .cfg-tab[data-tier="gold"] { border-color: #d4a417; background: linear-gradient(135deg, #fffaeb, #fff); }
#gtm-cfg2 .cfg-tab[data-tier="gold"].active { background: linear-gradient(135deg, #d4a417, #a87f10); border-color: #d4a417; }
#gtm-cfg2 .cfg-tab[data-tier="gold"] .cfg-tab-badge { background: #d4a417; }
#gtm-cfg2 .cfg-tab[data-tier="custom"] .cfg-tab-badge { background: #2980b9; }
#gtm-cfg2 .cfg-tab[data-tier="custom"].active .cfg-tab-badge { background: #e67e22; }

/* BUNDLE PANEL — Category-grouped components */
#gtm-cfg2 .bundle-cat-group { margin-bottom: 16px; }
#gtm-cfg2 .bundle-cat-group:last-child { margin-bottom: 0; }
#gtm-cfg2 .bundle-cat-head { font-size: 11px; color: #5a6878; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; padding-left: 2px; }
#gtm-cfg2 .bundle-cat-head i { color: #76B900; font-size: 13px; }
#gtm-cfg2 .bundle-cat-group .bundle-components { gap: 8px; }
#gtm-cfg2 .bundle-comp .qty-badge { background: #003A70; color: #fff !important; font-weight: 800; font-size: 11.5px; padding: 2px 8px; border-radius: 4px; margin-right: 6px; flex-shrink: 0; }
#gtm-cfg2 .bundle-comp .comp-text { flex: 1; font-size: 12.5px; color: #003A70; font-weight: 600; line-height: 1.4; }

/* TRUST */
#gtm-cfg2 .cfg-trust { margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef1f4; display: flex; flex-direction: column; gap: 6px; }
#gtm-cfg2 .cfg-trust-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #5a6878; }
#gtm-cfg2 .cfg-trust-item i { color: #76B900; width: 14px; text-align: center; }

/* TOAST */
#gtm-cfg2-toast { position: fixed; bottom: 20px; right: 20px; background: #c53030; color: #fff; padding: 14px 20px; border-radius: 10px; font-weight: 700; font-size: 13.5px; z-index: 99999; opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
#gtm-cfg2-toast.show { opacity: 1; transform: translateY(0); }
#gtm-cfg2-toast.success { background: #2f7a2f; }

/* CONTACT MODAL */
#gtm-cfg2-modal { display: none; position: fixed; inset: 0; background: rgba(0,30,60,.6); z-index: 99998; align-items: center; justify-content: center; padding: 20px; }
#gtm-cfg2-modal.show { display: flex; }
#gtm-cfg2-modal .modal-box { background: #fff; border-radius: 16px; padding: 32px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; }
#gtm-cfg2-modal h3 { margin: 0 0 6px; color: #003A70; font-size: 22px; font-weight: 800; }
#gtm-cfg2-modal p.modal-sub { margin: 0 0 18px; color: #5a6878; font-size: 13px; }
#gtm-cfg2-modal .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
#gtm-cfg2-modal .form-grid .full { grid-column: span 2; }
#gtm-cfg2-modal label { display: block; font-size: 11.5px; color: #5a6878; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
#gtm-cfg2-modal input, #gtm-cfg2-modal textarea, #gtm-cfg2-modal select { width: 100%; padding: 10px 12px; border: 1px solid #e1eaf2; border-radius: 8px; font-size: 13.5px; font-family: inherit; color: #003A70; background: #fff; }
#gtm-cfg2-modal input:focus, #gtm-cfg2-modal textarea:focus, #gtm-cfg2-modal select:focus { border-color: #003A70; outline: 0; box-shadow: 0 0 0 3px rgba(0,58,112,.1); }
#gtm-cfg2-modal textarea { min-height: 80px; resize: vertical; }
#gtm-cfg2-modal .kvkk { font-size: 11.5px; color: #5a6878; margin-top: 8px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
#gtm-cfg2-modal .kvkk input { width: auto; }
#gtm-cfg2-modal .modal-actions { display: flex; gap: 10px; margin-top: 18px; }
#gtm-cfg2-modal .modal-actions button { flex: 1; padding: 12px; border-radius: 10px; font-weight: 800; font-size: 13.5px; cursor: pointer; border: none; }
#gtm-cfg2-modal .modal-actions .submit { background: #e67e22; color: #fff; }
#gtm-cfg2-modal .modal-actions .submit:hover:not(:disabled) { background: #d47b10; }
#gtm-cfg2-modal .modal-actions .submit:disabled { background: #c0c8d2; cursor: not-allowed; }
#gtm-cfg2-modal .modal-actions .cancel { background: #f4f7fb; color: #003A70; border: 1px solid #e1eaf2; }
#gtm-cfg2-modal .modal-actions .cancel:hover { background: #eef4fb; }

@media (max-width: 992px) {
  #gtm-cfg2 .cfg-hero, #gtm-cfg2 .cfg-main { grid-template-columns: 1fr; }
  #gtm-cfg2 .cfg-summary { position: static; }
  #gtm-cfg2-modal .form-grid { grid-template-columns: 1fr; }
  #gtm-cfg2-modal .form-grid .full { grid-column: span 1; }
}
