/* ============================================
   AQM BD - Product Detail Page Styles
   Extracted from product_detail.php
   ============================================ */

:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --primary-dark: #0d1452;
    --accent: #ff6f00;
    --accent-light: #ff8f00;
    --success: #2e7d32;
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #1a1a2e;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; font-size: 14px; line-height: 1.6; color: var(--text); background: var(--bg); }

.top-bar { background: var(--primary-dark); padding: 8px 30px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: rgba(255,255,255,0.8); }
.top-bar a { color: #ffd54f; text-decoration: none; font-weight: 600; }
.header { background: var(--primary); padding: 18px 30px; }
.header-inner { max-width: 1600px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo img { height: 50px; border-radius: 8px; }
.logo-text { color: #fff; }
.logo-title { font-size: 24px; font-weight: 800; letter-spacing: 3px; }
.logo-sub { font-size: 11px; color: rgba(255,255,255,0.7); letter-spacing: 1px; }
.container-link { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--accent); border-radius: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 13px; position: relative; }
.container-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; background: #f44336; color: #fff; border-radius: 50%; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.nav { background: #fff; border-bottom: 2px solid var(--border); padding: 0 30px; display: flex; align-items: center; gap: 0; overflow-x: auto; }
.nav-link { padding: 14px 24px; color: var(--text-light); text-decoration: none; font-weight: 600; font-size: 13px; border-bottom: 3px solid transparent; white-space: nowrap; transition: all 0.2s; }
.nav-link:hover { color: var(--primary); background: #f8f9ff; }
.nav-link.active { color: var(--primary); border-bottom-color: var(--accent); font-weight: 700; }
.nav-separator { flex: 1; }

.breadcrumb { padding: 12px 30px; max-width: 1600px; margin: 0 auto; font-size: 12px; }
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 600; }
.breadcrumb span { color: var(--text-light); margin: 0 6px; }

.main { max-width: 1400px; margin: 0 auto; padding: 0 30px 30px; }

/* PRODUCT DETAIL LAYOUT */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }

/* IMAGE */
.detail-image { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; border: 1px solid var(--border); }
.detail-image img { width: 100%; height: 400px; object-fit: cover; }
.detail-image .placeholder { width: 100%; height: 400px; display: flex; align-items: center; justify-content: center; background: #f0f0f0; font-size: 80px; color: #ccc; }
.origin-badge { position: absolute; top: 16px; left: 16px; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 6px; color: #fff; }
.origin-badge.pt { background: #006600; }
.origin-badge.cn { background: #de2910; }
.origin-badge.vn { background: #da251d; }
.origin-badge.bd { background: #006a4e; }
.origin-badge.multi { background: #455a64; }
.eco-badge { position: absolute; top: 16px; right: 16px; font-size: 11px; font-weight: 700; padding: 6px 10px; border-radius: 6px; background: var(--success); color: #fff; }
.material-badge { position: absolute; bottom: 16px; left: 16px; font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 6px; color: #fff; }
.material-badge.Paper { background: #5d4037; }
.material-badge.Plastic { background: #e65100; }
.material-badge.Textile { background: #1565c0; }

/* INFO PANEL */
.detail-info { display: flex; flex-direction: column; gap: 16px; }

.info-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 20px; }
.info-card-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); font-weight: 700; margin-bottom: 12px; }

.product-name { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.3; margin-bottom: 6px; }
.product-desc { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; }
.product-material { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.cert-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cert-tag { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: #e8f5e9; color: var(--success); }

/* VARIANT SELECTOR */
.variant-select { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text); background: #fff; cursor: pointer; }
.variant-select:focus { outline: none; border-color: var(--primary); }

/* PRICE COMPARISON TABLE */
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th { text-align: left; padding: 10px 14px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); background: #f8f9ff; border-bottom: 2px solid var(--border); }
.compare-table td { padding: 12px 14px; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.compare-table .label-col { color: var(--text-light); font-weight: 600; width: 40%; }
.compare-table .our-col { font-weight: 700; color: var(--success); background: #f1f8e9; }
.compare-table .eu-col { font-weight: 700; color: #e65100; background: #fff8e1; }
.compare-table .diff-col { font-weight: 700; text-align: center; }
.compare-table .total-row td { border-top: 3px solid var(--border); font-size: 15px; padding: 14px; }
.margin-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; color: #fff; }
.margin-badge.high { background: var(--success); }
.margin-badge.medium { background: var(--accent); }
.margin-badge.low { background: #ff5722; }

/* COST BREAKDOWN */
.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cost-row { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 12px; border-bottom: 1px solid #f5f5f5; }
.cost-row .cr-label { color: var(--text-light); }
.cost-row .cr-value { font-weight: 700; }
.cost-row.total { background: #f8f9ff; border-top: 2px solid var(--primary); }
.cost-row.total .cr-label { color: var(--text); font-weight: 700; }
.cost-row.total .cr-value { color: var(--primary); font-size: 14px; }

/* MARGIN VISUAL */
.margin-visual { background: linear-gradient(135deg, #e8f5e9, #f1f8e9); border: 2px solid #a5d6a7; border-radius: var(--radius); padding: 20px; text-align: center; }
.margin-big { font-size: 48px; font-weight: 800; color: var(--success); }
.margin-label { font-size: 13px; color: var(--text-light); font-weight: 600; }
.margin-bar { height: 8px; border-radius: 4px; background: #e0e0e0; margin-top: 12px; overflow: hidden; }
.margin-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.margin-bar-fill.high { background: var(--success); }
.margin-bar-fill.medium { background: var(--accent); }
.margin-bar-fill.low { background: #ff5722; }

/* ADD TO CONTAINER */
.add-row { display: flex; gap: 10px; align-items: center; }
.qty-control { display: flex; align-items: center; background: #f5f5f5; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.qty-btn { width: 40px; height: 44px; border: none; background: transparent; font-size: 18px; font-weight: 600; cursor: pointer; }
.qty-btn:hover { background: #e0e0e0; }
.qty-input { width: 70px; height: 44px; border: none; text-align: center; font-size: 14px; font-weight: 600; background: #fff; }
.btn-add { flex: 1; padding: 14px 20px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.btn-add:hover { background: var(--primary-light); }
.btn-add.added { background: var(--success); }

/* SPECS TABLE */
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td { padding: 8px 0; font-size: 12px; border-bottom: 1px solid #f5f5f5; }
.specs-table td:first-child { color: var(--text-light); width: 40%; font-weight: 600; }
.specs-table td:last-child { font-weight: 600; color: var(--text); }

/* VARIANTS TABLE */
.variants-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.variants-table th { padding: 8px 10px; background: #f8f9ff; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); border-bottom: 2px solid var(--border); }
.variants-table td { padding: 8px 10px; border-bottom: 1px solid #f5f5f5; }
.variants-table tr:hover { background: #fafbfc; }
.variants-table .sku { font-family: monospace; font-size: 11px; color: var(--text-light); }

/* RELATED */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 16px; }
.related-card { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); text-decoration: none; color: inherit; transition: all 0.3s; }
.related-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.related-card img { width: 100%; height: 160px; object-fit: cover; }
.related-card-info { padding: 12px; }
.related-card-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.related-card-price { font-size: 12px; color: var(--accent); font-weight: 700; }

.toast { position: fixed; bottom: 25px; right: 25px; padding: 14px 24px; background: var(--success); color: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); font-weight: 600; z-index: 10001; font-size: 13px; transform: translateY(100px); opacity: 0; transition: all 0.3s; }
.toast.show { transform: translateY(0); opacity: 1; }

.footer { background: var(--primary-dark); color: rgba(255,255,255,0.7); padding: 30px; text-align: center; font-size: 12px; margin-top: 40px; }
.footer a { color: #ffd54f; text-decoration: none; }

@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 12px; }
    .main { padding: 0 16px 16px; }
    .detail-image img, .detail-image .placeholder { height: 250px; }
    .cost-grid { grid-template-columns: 1fr; }
    .compare-table { font-size: 12px; }
}

/* ============================================
   UTILITY CLASSES (replacing inline styles)
   ============================================ */
.d-none { display: none; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.overflow-x-auto { overflow-x: auto; }
.flex-between { display: flex; justify-content: space-between; }
.flex-center-gap { display: flex; align-items: center; gap: 10px; }

/* Text helpers */
.text-sm-light { font-size: 12px; color: var(--text-light); }
.text-xs-muted { font-size: 10px; color: var(--text-light); }
.price-fob-display { font-size: 18px; font-weight: 800; color: var(--text); }
.cr-value--muted { color: var(--text-light); }

/* EU Price Comparison card */
.info-card--compare { border: 2px solid #ffe082; background: linear-gradient(135deg, #fffde7, #fff8e1); }
.info-card-title--compare { color: #f57f17; }
.diff-col--highlight { color: var(--success); font-size: 15px; }
.source-note { margin-top: 8px; font-size: 10px; color: #9e9e9e; text-align: right; }

/* Visual comparison card */
.info-card--visual { background: #fafafa; }

/* Visual bar row */
.vis-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vis-bar-row:last-child { margin-bottom: 0; }
.vis-bar-label { font-size: 12px; font-weight: 700; width: 100px; }
.vis-bar-label--ours { color: var(--success); }
.vis-bar-label--eu-min { color: #e65100; }
.vis-bar-label--eu-max { color: #c62828; }
.vis-bar-track { flex: 1; border-radius: 6px; height: 32px; position: relative; }
.vis-bar-track--ours { background: #e8f5e9; }
.vis-bar-track--eu-min { background: #fff3e0; }
.vis-bar-track--eu-max { background: #ffebee; }
.vis-bar-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; transition: width 0.5s; width: var(--bar-w, 50%); }
.vis-bar-fill--ours { background: linear-gradient(90deg, #43a047, #2e7d32); }
.vis-bar-fill--eu-min { background: linear-gradient(90deg, #ff9800, #e65100); }
.vis-bar-fill--eu-max { background: linear-gradient(90deg, #ef5350, #c62828); width: 100%; }
.vis-bar-price { font-size: 12px; font-weight: 800; color: #fff; }

/* Margin summary box */
.margin-summary { text-align: center; padding: 16px; background: linear-gradient(135deg, #e8f5e9, #f1f8e9); border-radius: 8px; border: 2px solid #a5d6a7; }
.margin-summary-label { font-size: 13px; color: var(--text-light); font-weight: 600; }
.margin-summary-pct { font-size: 48px; font-weight: 800; color: var(--success); }
.margin-bar--centered { max-width: 300px; margin: 8px auto 0; }
.margin-summary-note { font-size: 10px; color: var(--text-light); margin-top: 6px; }

/* Cost note box */
.cost-note { margin-top: 10px; padding: 10px; background: #f8f9ff; border-radius: 6px; font-size: 11px; color: var(--text-light); }

/* Footer utility */
.footer p + p { margin-top: 8px; }
