/* ============================================================
   MES B2B eCommerce - Main Stylesheet
   Corporate Industrial Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@600;700&family=Source+Sans+3:wght@400;600&display=swap');

/* ─── CSS Variables ───────────────────────────────────────────*/
:root {
    --navy:        #1a2744;
    --navy-light:  #253356;
    --navy-dark:   #111b33;
    --orange:      #e8521a;
    --orange-dark: #c9420d;
    --steel:       #4a5568;
    --steel-light: #718096;
    --bg-light:    #f4f6f8;
    --bg-white:    #ffffff;
    --border:      #dce1e9;
    --text:        #2d3748;
    --text-muted:  #718096;
    --success:     #2d7d46;
    --warning:     #b7791f;
    --danger:      #c53030;
    --font-main:   'Barlow', sans-serif;
    --font-display:'Barlow Condensed', sans-serif;
    --font-body:   'Source Sans 3', sans-serif;
    --radius:      4px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --shadow:      0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg:   0 8px 24px rgba(0,0,0,0.12);
    --transition:  0.2s ease;
}

/* ─── Reset & Base ────────────────────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-light);
    margin: 0;
}

a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    font-weight: 700;
    color: var(--navy);
    line-height: 1.3;
}

img { max-width: 100%; height: auto; }

/* ─── Top Bar ─────────────────────────────────────────────────*/
.topbar {
    background: var(--navy-dark);
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    padding: 6px 0;
}
.topbar a { color: rgba(255,255,255,0.75); }
.topbar a:hover { color: var(--orange); }
.topbar .iso-badge {
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

/* ─── Navbar ──────────────────────────────────────────────────*/
.navbar-mes {
    background: var(--navy);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.navbar-mes .navbar-brand {
    padding: 10px 0;
}
.navbar-mes .brand-name {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    line-height: 1;
}
.navbar-mes .brand-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.navbar-mes .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 14px;
    padding: 20px 14px !important;
    letter-spacing: 0.3px;
    transition: all var(--transition);
    position: relative;
}
.navbar-mes .nav-link:hover,
.navbar-mes .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.06);
}
.navbar-mes .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--orange);
}
.navbar-mes .dropdown-menu {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border-top: 3px solid var(--orange);
    margin-top: 0;
}
.navbar-mes .cart-btn {
    background: var(--orange);
    color: #fff !important;
    border-radius: var(--radius);
    padding: 8px 16px !important;
    margin: auto 0;
    font-size: 14px;
}
.navbar-mes .cart-btn:hover { background: var(--orange-dark) !important; }
.cart-count-badge {
    background: #fff;
    color: var(--orange);
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    padding: 1px 5px;
    margin-left: 4px;
}

/* ─── Hero Slider ─────────────────────────────────────────────*/
.hero-section {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #1f3060 100%);
    color: #fff;
    padding: 80px 0 70px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    right: -5%;
    top: -10%;
    width: 60%;
    height: 120%;
    background: url('/assets/images/hero-pattern.svg') no-repeat center;
    opacity: 0.04;
    background-size: cover;
}
.hero-section .hero-tagline {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.5px;
}
.hero-section .hero-sub {
    font-size: 17px;
    opacity: 0.85;
    max-width: 520px;
    margin-top: 12px;
}
.hero-section .iso-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.iso-pill {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}
.hero-cta {
    display: inline-block;
    background: var(--orange);
    color: #fff;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: var(--radius);
    margin-top: 24px;
    transition: background var(--transition), transform var(--transition);
}
.hero-cta:hover {
    background: var(--orange-dark);
    color: #fff;
    transform: translateY(-1px);
}
.hero-cta-secondary {
    display: inline-block;
    border: 2px solid rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 15px;
    padding: 11px 26px;
    border-radius: var(--radius);
    margin-top: 24px;
    margin-left: 12px;
    transition: all var(--transition);
}
.hero-cta-secondary:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ─── Stats Bar ───────────────────────────────────────────────*/
.stats-bar {
    background: var(--orange);
    color: #fff;
    padding: 16px 0;
}
.stat-item {
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.25);
}
.stat-item:last-child { border-right: none; }
.stat-number {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Section Titles ──────────────────────────────────────────*/
.section-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.3px;
}
.section-title .accent { color: var(--orange); }
.section-divider {
    width: 50px;
    height: 3px;
    background: var(--orange);
    margin: 10px 0 24px;
}

/* ─── Product Card ────────────────────────────────────────────*/
.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    height: 100%;
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.product-card .card-img-wrap {
    background: #f8f8f8;
    overflow: hidden;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}
.product-card .card-img-wrap img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .card-img-wrap img {
    transform: scale(1.04);
}
.product-card .card-body {
    padding: 16px;
}
.product-card .product-name {
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .product-sku {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 8px;
}
.product-card .product-price {
    font-family: var(--font-main);
    font-size: 18px;
    font-weight: 700;
    color: var(--orange);
}
.product-card .product-moq {
    font-size: 11px;
    color: var(--text-muted);
}
.product-card .card-footer {
    background: none;
    border-top: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    gap: 8px;
}

/* ─── Buttons ─────────────────────────────────────────────────*/
.btn-primary-mes {
    background: var(--navy);
    color: #fff;
    border: none;
    font-family: var(--font-main);
    font-weight: 600;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-primary-mes:hover { background: var(--navy-light); color: #fff; }

.btn-orange {
    background: var(--orange);
    color: #fff;
    border: none;
    font-family: var(--font-main);
    font-weight: 600;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-orange:hover { background: var(--orange-dark); color: #fff; }

.btn-outline-mes {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--navy);
    font-family: var(--font-main);
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-outline-mes:hover { background: var(--navy); color: #fff; }

/* ─── Order Status Timeline ───────────────────────────────────*/
.order-timeline {
    display: flex;
    align-items: center;
    padding: 20px 0;
}
.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
}
.timeline-step::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.timeline-step:last-child::before { display: none; }
.timeline-step.done::before { background: var(--success); }
.timeline-step.active::before { background: var(--border); }

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 6px;
    position: relative;
    z-index: 1;
    font-size: 14px;
    color: var(--text-muted);
    transition: all var(--transition);
}
.timeline-step.done .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.timeline-step.active .step-circle {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}
.step-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.timeline-step.done .step-label,
.timeline-step.active .step-label { color: var(--text); }

/* ─── Tables ──────────────────────────────────────────────────*/
.mes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.mes-table th {
    background: var(--navy);
    color: #fff;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
}
.mes-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.mes-table tr:hover td { background: #fafbfc; }
.mes-table tr:last-child td { border-bottom: none; }

/* ─── Cards ───────────────────────────────────────────────────*/
.mes-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.mes-card .mes-card-header {
    background: var(--navy);
    color: #fff;
    padding: 12px 20px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mes-card .mes-card-header .bi { font-size: 18px; }
.mes-card .mes-card-body { padding: 20px; }

/* ─── Customer Dashboard ──────────────────────────────────────*/
.dash-stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition);
}
.dash-stat-card:hover { box-shadow: var(--shadow); }
.dash-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.dash-stat-icon.navy { background: rgba(26,39,68,0.1); color: var(--navy); }
.dash-stat-icon.orange { background: rgba(232,82,26,0.1); color: var(--orange); }
.dash-stat-icon.green { background: rgba(45,125,70,0.1); color: var(--success); }
.dash-stat-icon.yellow { background: rgba(183,121,31,0.1); color: var(--warning); }
.dash-stat-number {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}
.dash-stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Sidebar Navigation ──────────────────────────────────────*/
.sidebar-nav {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.sidebar-nav .nav-header {
    background: var(--navy);
    color: #fff;
    padding: 12px 16px;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}
.sidebar-nav .nav-link:last-child { border-bottom: none; }
.sidebar-nav .nav-link:hover { background: var(--bg-light); color: var(--navy); }
.sidebar-nav .nav-link.active {
    background: rgba(26,39,68,0.06);
    color: var(--navy);
    font-weight: 600;
    border-left: 3px solid var(--orange);
}
.sidebar-nav .nav-link .bi { font-size: 16px; color: var(--steel-light); }
.sidebar-nav .nav-link.active .bi { color: var(--orange); }

/* ─── Forms ───────────────────────────────────────────────────*/
.mes-form .form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 5px;
}
.mes-form .form-control, .mes-form .form-select {
    border-color: var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    padding: 9px 12px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.mes-form .form-control:focus, .mes-form .form-select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26,39,68,0.1);
}

/* ─── Alert Styles ────────────────────────────────────────────*/
.alert-success { border-left: 4px solid var(--success); }
.alert-danger   { border-left: 4px solid var(--danger); }
.alert-warning  { border-left: 4px solid var(--warning); }
.alert-info     { border-left: 4px solid #3182ce; }

/* ─── Footer ──────────────────────────────────────────────────*/
.site-footer {
    background: var(--navy-dark);
    color: rgba(255,255,255,0.75);
    padding: 52px 0 0;
    margin-top: 60px;
}
.site-footer h5 {
    color: #fff;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
}
.site-footer a { color: rgba(255,255,255,0.7); font-size: 14px; }
.site-footer a:hover { color: var(--orange); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 8px; }
.footer-bottom {
    background: var(--navy-dark);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 16px 0;
    margin-top: 36px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}
.footer-certifications {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.cert-badge {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

/* ─── Admin Specific ──────────────────────────────────────────*/
.admin-sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--navy);
    flex-shrink: 0;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}
.admin-content {
    margin-left: 240px;
    min-height: 100vh;
    background: var(--bg-light);
}
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.admin-stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    border-left: 4px solid var(--navy);
}
.admin-stat-card.orange { border-left-color: var(--orange); }
.admin-stat-card.green  { border-left-color: var(--success); }
.admin-stat-card.yellow { border-left-color: var(--warning); }

/* ─── Page-specific ───────────────────────────────────────────*/
.breadcrumb-mes {
    background: none;
    padding: 0;
    font-size: 13px;
}
.breadcrumb-mes .breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

.page-header {
    background: var(--navy);
    color: #fff;
    padding: 24px 0;
    margin-bottom: 30px;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px;
}

/* ─── Responsive ──────────────────────────────────────────────*/
@media (max-width: 991px) {
    .hero-section .hero-tagline { font-size: 30px; }
    .admin-sidebar { position: relative; width: 100%; min-height: auto; }
    .admin-content { margin-left: 0; }
}
@media (max-width: 767px) {
    .stats-bar .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.2); }
    .order-timeline { overflow-x: auto; }
}
