/* ============================================
   AQM BD - Container Page Styles
   Extracted from container.php
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f5f5f5; color: #1a1a1a; line-height: 1.6; }

/* DYNAMIC BANNER */
.lang-banner { height: 50px; background-size: cover; background-position: center; position: relative; }
.banner-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.2); display: flex; justify-content: flex-end; align-items: center; padding: 0 30px; }
.lang-switch { display: flex; gap: 4px; background: rgba(255,255,255,0.95); padding: 4px 8px; border-radius: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.lang-btn { padding: 4px 8px; border: none; background: transparent; color: #333; font-weight: 700; font-size: 10px; cursor: pointer; border-radius: 12px; text-decoration: none; }
.lang-btn:hover { background: rgba(0,0,0,0.1); }
.lang-btn.active { background: var(--primary); color: #fff; }

/* CSS VARIABLES FOR DYNAMIC THEMING */
:root {
    --primary: #c41e3a;
    --primary-dark: #a01830;
    --secondary: #ffffff;
    --accent: #012169;
    --header-gradient: linear-gradient(135deg, #012169 0%, #c41e3a 100%);
    --nav-bg: #a01830;
}
body.lang-en {
    --primary: #c41e3a; --primary-dark: #a01830; --secondary: #ffffff; --accent: #012169;
    --header-gradient: linear-gradient(135deg, #012169 0%, #c41e3a 100%); --nav-bg: #a01830;
}
body.lang-pt {
    --primary: #003399; --primary-dark: #002266; --secondary: #ffd700; --accent: #006600;
    --header-gradient: linear-gradient(135deg, #003399 0%, #002266 100%); --nav-bg: #002266;
}
body.lang-es {
    --primary: #c60b1e; --primary-dark: #9a0916; --secondary: #ffc400; --accent: #c60b1e;
    --header-gradient: linear-gradient(135deg, #c60b1e 0%, #9a0916 100%); --nav-bg: #9a0916;
}
body.lang-fr {
    --primary: #002395; --primary-dark: #001a6e; --secondary: #ffffff; --accent: #ed2939;
    --header-gradient: linear-gradient(135deg, #002395 0%, #ed2939 100%); --nav-bg: #001a6e;
}

.header { background: var(--header-gradient); padding: 15px 30px; }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 60px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.logo-text { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 2px; }
.logo.has-image .logo-text { display: none; }
.logo:hover img { transform: scale(1.05); }
.header-title { text-align: center; }
.header-title h1 { font-size: 28px; font-weight: 800; color: #fff; letter-spacing: 4px; }
.header-title p { font-size: 12px; color: var(--secondary); letter-spacing: 2px; }

.nav { background: var(--nav-bg); display: flex; justify-content: center; gap: 5px; padding: 0 30px; }
.nav a { padding: 14px 25px; color: rgba(255,255,255,0.9); text-decoration: none; font-weight: 600; font-size: 12px; text-transform: uppercase; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav a.active { color: var(--secondary); border-bottom-color: var(--secondary); }

.page-header { background: #fff; padding: 20px 30px; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; }
.page-title h2 { font-size: 24px; color: var(--primary); margin-bottom: 5px; }
.page-subtitle { font-size: 13px; color: #757575; }
.page-stats { display: flex; gap: 15px; flex-wrap: wrap; }
.stat-box { text-align: center; padding: 10px 20px; background: #f5f5f5; border-radius: 8px; border: 2px solid var(--primary); }
.stat-value { font-size: 20px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 10px; color: #757575; text-transform: uppercase; }

.warning-banner { background: #fff3e0; border: 2px solid #ff9800; border-radius: 8px; padding: 12px 20px; margin: 20px 30px 0; display: flex; align-items: center; gap: 12px; }
.warning-icon { font-size: 24px; }
.warning-text { font-size: 13px; color: #e65100; font-weight: 600; }

.main { max-width: 1600px; margin: 0 auto; padding: 25px; display: grid; grid-template-columns: 1fr 380px; gap: 25px; }

.items-section { background: #fff; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.08); overflow: hidden; position: relative; }
.items-header { background: var(--primary); padding: 15px 20px; color: #fff; display: flex; justify-content: space-between; align-items: center; }
.items-title { font-size: 14px; font-weight: 700; text-transform: uppercase; }
.clear-btn { background: var(--accent); color: #fff; border: none; padding: 8px 15px; border-radius: 5px; font-size: 11px; font-weight: 600; cursor: pointer; }

/* Card-based container items */
.container-cards { padding: 15px; display: flex; flex-direction: column; gap: 12px; }

.container-card { border: 2px solid #e8e8e8; border-radius: 10px; overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s; }
.container-card:hover { border-color: var(--primary); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.container-card.missing-dims { border-color: #ff9800; background: #fffbf0; }

.card-header { display: flex; align-items: center; gap: 12px; padding: 12px 15px; background: #fafafa; border-bottom: 1px solid #f0f0f0; }
.card-image { width: 48px; height: 48px; background: #f0f0f0; border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { font-size: 22px; }
.card-title { flex: 1; min-width: 0; }
.item-name { display: block; font-size: 13px; font-weight: 700; color: #1a1a1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sku { display: block; font-size: 10px; color: #9e9e9e; margin-top: 2px; }

.card-body { padding: 12px 15px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.card-body > label, .card-field > label, .card-dims > label { display: block; font-size: 10px; font-weight: 700; color: #757575; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }

.card-field { min-width: 100px; }
.card-field--qty { min-width: 140px; }
.card-value { display: flex; align-items: baseline; gap: 4px; }

.card-dims { flex: 1; min-width: 200px; }

.qty-control { display: flex; align-items: center; gap: 4px; }
.qty-btn { width: 30px; height: 30px; border: 1px solid #e0e0e0; background: #fff; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 16px; color: var(--primary); transition: all 0.15s; }
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qty-input { width: 60px; height: 30px; text-align: center; border: 1px solid #e0e0e0; border-radius: 6px; font-weight: 700; font-size: 13px; }
.qty-input:focus { border-color: var(--primary); outline: none; }

/* Box Dimension Inputs with labels */
.dim-inputs { display: flex; gap: 6px; align-items: flex-end; }
.input-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.dim-label { font-size: 9px; font-weight: 700; color: #9e9e9e; text-transform: uppercase; }
.dim-input { width: 48px; height: 30px; text-align: center; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 12px; font-weight: 600; transition: border-color 0.15s; }
.dim-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 2px rgba(196,30,58,0.1); }
.dim-input.missing { border-color: #ff9800; background: #fff8e1; }
.dim-x { font-size: 12px; color: #bbb; padding-bottom: 6px; }

.boxes-count { font-size: 16px; font-weight: 800; color: var(--primary); }
.boxes-calc { font-size: 10px; color: #757575; }

.card-footer { display: flex; gap: 0; border-top: 1px solid #f0f0f0; }
.card-stat { flex: 1; padding: 10px 15px; text-align: center; border-right: 1px solid #f0f0f0; }
.card-stat:last-child { border-right: none; }
.card-stat .stat-label { display: block; font-size: 9px; font-weight: 700; color: #9e9e9e; text-transform: uppercase; margin-bottom: 2px; }
.item-cbm { font-size: 13px; font-weight: 700; color: #333; }
.item-weight { font-size: 13px; font-weight: 600; color: #333; }
.item-price { font-size: 14px; font-weight: 800; color: var(--primary); }
.card-stat--price { background: #fafafa; }

.remove-btn { background: none; border: none; color: #c62828; cursor: pointer; font-size: 18px; padding: 6px; border-radius: 6px; transition: background 0.15s; flex-shrink: 0; }
.remove-btn:hover { background: #ffebee; }

.empty-container { text-align: center; padding: 60px 20px; color: #9e9e9e; }
.empty-icon { font-size: 60px; margin-bottom: 15px; }
.empty-text { font-size: 16px; margin-bottom: 20px; }
.browse-btn { display: inline-block; padding: 12px 25px; background: #1a237e; color: #fff; text-decoration: none; border-radius: 8px; font-weight: 600; }

.right-panel { display: flex; flex-direction: column; gap: 20px; }

.container-select { background: #fff; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.08); overflow: hidden; }
.panel-header { background: var(--primary); padding: 15px 20px; }
.panel-title { font-size: 13px; font-weight: 700; color: #fff; text-transform: uppercase; }
.panel-content { padding: 15px; }
.container-option { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px solid #e0e0e0; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s; }
.container-option:hover { border-color: var(--primary); }
.container-option.selected { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.1); }
.container-option input { display: none; }
.container-icon { width: 50px; height: 30px; background: linear-gradient(135deg, #ff9800, #f57c00); border-radius: 4px; position: relative; }
.container-icon::after { content: ''; position: absolute; right: -4px; top: 3px; bottom: 3px; width: 8px; background: #e65100; border-radius: 0 3px 3px 0; }
.container-info { flex: 1; }
.container-name { font-size: 12px; font-weight: 700; color: #1a1a1a; }
.container-specs { font-size: 10px; color: #757575; }
.container-cost { font-size: 14px; font-weight: 700; color: var(--primary); }

.summary-box { background: #fff; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.08); overflow: hidden; }
.summary-content { padding: 15px; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.summary-row:last-child { border-bottom: none; }
.summary-row--landed { border-top: 2px solid var(--primary); padding-top: 12px; margin-top: 6px; }
.summary-label { color: #616161; }
.summary-label--bold { font-weight: 700; }
.summary-value { font-weight: 600; color: #1a1a1a; }
.summary-value--primary { color: var(--primary); }
.summary-total { background: var(--primary); padding: 15px; display: flex; justify-content: space-between; align-items: center; }
.total-label { font-size: 14px; color: rgba(255,255,255,0.9); }
.total-value { font-size: 24px; font-weight: 800; color: var(--secondary); }

.fill-section { padding: 15px; background: #f5f5f5; position: relative; }
/* Cultural banner strip in fill section */
.fill-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--header-gradient); }
.fill-label { font-size: 11px; color: #616161; margin-bottom: 8px; display: flex; justify-content: space-between; }
.fill-bar { height: 12px; background: #e0e0e0; border-radius: 6px; overflow: hidden; }
.fill-progress { height: 100%; background: linear-gradient(90deg, #4caf50, #8bc34a); border-radius: 6px; transition: width 0.3s; }
.fill-progress.warning { background: linear-gradient(90deg, #ff9800, #ffc107); }
.fill-progress.danger { background: linear-gradient(90deg, #f44336, #e57373); }

.actions-box { background: #fff; border-radius: 12px; box-shadow: 0 2px 15px rgba(0,0,0,0.08); padding: 20px; position: relative; overflow: hidden; }
/* Cultural banner background in actions — bg-image set via nonce style */
.actions-box::before { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background-size: cover; background-position: center bottom; opacity: 0.1; }
.action-btn { width: 100%; padding: 14px; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; position: relative; z-index: 1; }
.action-btn:last-child { margin-bottom: 0; }
.btn-load { background: var(--secondary); color: var(--primary); }
body.lang-en .btn-load, body.lang-fr .btn-load { background: #ffd54f; color: var(--primary); }
.btn-load:hover { opacity: 0.9; }
.btn-load:disabled { background: #ccc; cursor: not-allowed; }
.btn-quote { background: var(--primary); color: #fff; }
.btn-quote:hover { background: var(--primary-dark); }
.btn-export { background: var(--accent); color: #fff; }
.btn-export-pdf { background: #c62828; color: #fff; }
body.lang-pt .btn-export { background: #006600; }
body.lang-es .btn-export { background: #c60b1e; }
body.lang-fr .btn-export { background: #ed2939; }
.btn-export:hover, .btn-export-pdf:hover { opacity: 0.9; }

.toast { position: fixed; bottom: 25px; right: 25px; padding: 14px 22px; background: var(--primary); color: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); font-weight: 600; z-index: 10001; }

/* Cultural accent strip on items section */
.items-section::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 5px; background: var(--header-gradient); }

/* Footer */
.ct-footer { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); color: #fff; padding: 40px 30px 20px; margin-top: 50px; }
.ct-footer-inner { max-width: 1400px; margin: 0 auto; }
.ct-footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 30px; }
.ct-footer-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.ct-footer-brand img { height: 50px; border-radius: 50%; }
.ct-footer-company { font-size: 20px; font-weight: 800; letter-spacing: 2px; }
.ct-footer-federation { font-size: 11px; color: #ffd54f; }
.ct-footer-desc { font-size: 12px; color: rgba(255,255,255,0.7); line-height: 1.8; }
.ct-footer-heading { font-size: 14px; font-weight: 700; margin-bottom: 15px; color: #ffd54f; }
.ct-footer-text { font-size: 12px; color: rgba(255,255,255,0.8); line-height: 2; }
.ct-footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; }
.ct-footer-copyright { font-size: 11px; color: rgba(255,255,255,0.5); }

@media (max-width: 1200px) {
    .main { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .card-body { flex-direction: column; }
    .card-dims { min-width: 0; }
    .card-footer { flex-wrap: wrap; }
    .card-stat { min-width: 33%; }
    .dim-input { width: 44px; }
    .page-stats { width: 100%; justify-content: center; }
}
