/**
 * B2B E-commerce - Mobile Responsive Styles
 * Colors: white, black, orange, green, blue, red
 */
:root {
    --white: #ffffff;
    --black: #1a1a1a;
    --orange: #e67e22;
    --orange-light: #f39c12;
    --orange-dark: #d35400;
    --green: #27ae60;
    --green-light: #2ecc71;
    --green-dark: #1e8449;
    --blue: #3498db;
    --blue-light: #5dade2;
    --blue-dark: #2980b9;
    --red: #e74c3c;
    --red-light: #ec7063;
    --red-dark: #c0392b;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--black);
    background: var(--white);
    min-height: 100vh;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--blue-dark); }

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Offer Bar - above navbar */
.offer-bar {
    background: linear-gradient(90deg, var(--orange) 0%, var(--orange-dark) 100%);
    color: var(--white);
    padding: 8px 0;
    overflow: hidden;
}
.offer-scroll-wrap { overflow: hidden; }
.offer-scroll {
    display: flex;
    align-items: center;
    animation: offerScroll 25s linear infinite;
    width: max-content;
}
.offer-scroll:hover { animation-play-state: paused; }
.offer-item {
    color: var(--white);
    text-decoration: none;
    white-space: nowrap;
    padding: 0 20px;
    font-size: 0.9rem;
}
.offer-item:hover { text-decoration: underline; }
.offer-sep { color: rgba(255,255,255,0.6); padding: 0 10px; font-size: 0.7rem; }
@keyframes offerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@media (max-width: 768px) {
    .offer-bar { padding: 6px 0; }
    .offer-item { font-size: 0.8rem; padding: 0 15px; }
}

/* Header / Navbar */
.navbar {
    background: var(--black);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.navbar .logo {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 700;
}
.navbar .logo span { color: var(--orange); }
.navbar .nav-menu {
    display: flex;
    list-style: none;
    gap: 20px;
}
.navbar .nav-menu a {
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.navbar .nav-icon { display: inline-flex; flex-shrink: 0; }
.sidebar-nav .nav-icon { display: inline-flex; flex-shrink: 0; margin-right: 4px; }
.navbar .nav-menu a:hover,
.navbar .nav-menu a.active {
    background: var(--orange);
    color: var(--white);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}
.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
}
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .navbar .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 15px 0;
    }
    .navbar .nav-menu.active {
        display: flex;
    }
}

/* Login Page */
.login-section {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--white) 100%);
}
.login-wrapper {
    width: 100%;
    max-width: 420px;
}
.login-tabs {
    display: flex;
    background: var(--gray-200);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    overflow: hidden;
}
.login-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    transition: var(--transition);
}
.login-tab.active {
    background: var(--white);
    color: var(--orange);
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}
.login-tab:hover:not(.active) {
    background: var(--gray-300);
}
.login-container {
    background: var(--white);
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}
.login-container .tab-content { display: none; }
.login-container .tab-content.active { display: block; }
.login-header {
    margin-bottom: 25px;
}
.login-header h1 {
    font-size: 1.5rem;
    color: var(--black);
    margin-bottom: 5px;
}
.login-header p {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--black);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.form-options a { font-size: 0.9rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.btn-full { width: 100%; }
.btn-primary {
    background: var(--orange);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--orange-dark);
    color: var(--white);
}
.btn-secondary {
    background: var(--blue);
    color: var(--white);
}
.btn-secondary:hover {
    background: var(--blue-dark);
    color: var(--white);
}
.btn-success {
    background: var(--green);
    color: var(--white);
}
.btn-danger {
    background: var(--red);
    color: var(--white);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--orange);
    color: var(--orange);
}
.btn-outline:hover {
    background: var(--orange);
    color: var(--white);
}

/* Landing Page */
.landing-hero {
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--black) 0%, var(--gray-800) 100%);
    color: var(--white);
}
.landing-hero h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}
.landing-hero h1 span { color: var(--orange); }
.landing-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 35px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.login-choices {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.login-choice-card {
    background: var(--white);
    color: var(--black);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    min-width: 200px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}
.login-choice-card:hover {
    transform: translateY(-5px);
    border-color: var(--orange);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.login-choice-card.admin { border-left: 4px solid var(--red); }
.login-choice-card.customer { border-left: 4px solid var(--green); }
.login-choice-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}
.login-choice-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 20px;
}
.login-choice-card .btn { margin-top: 10px; }

/* Sidebar (Admin / Customer panels) */
.sidebar {
    width: 260px;
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 999;
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header .logo {
    font-size: 1.2rem;
    font-weight: 700;
}
.sidebar-header .logo span { color: var(--orange); }
.sidebar-nav {
    padding: 15px 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(230, 126, 34, 0.2);
    color: var(--orange);
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer .user-info {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}
.sidebar-footer .btn {
    margin-top: 10px;
    width: 100%;
    background: var(--red);
    color: var(--white);
    padding: 8px;
}
.sidebar-footer .btn:hover { background: var(--red-dark); }

/* Main content area */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--gray-100);
}
.main-content {
    padding: 25px;
}
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
    }
}

/* Dashboard cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 4px solid var(--orange);
}
.stat-card.green { border-left-color: var(--green); }
.stat-card.blue { border-left-color: var(--blue); }
.stat-card.red { border-left-color: var(--red); }
.stat-card h3 {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}
.stat-card .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--black);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
th, td {
    padding: 12px 15px;
    text-align: left;
}
th {
    background: var(--black);
    color: var(--white);
    font-weight: 600;
}
tr:nth-child(even) { background: var(--gray-100); }
tr:hover { background: var(--gray-200); }

/* Mobile header for sidebar toggle */
.mobile-header {
    display: none;
    padding: 15px 20px;
    background: var(--black);
    color: var(--white);
    justify-content: space-between;
    align-items: center;
}
.mobile-header .sidebar-toggle {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}
@media (max-width: 992px) {
    .mobile-header { display: flex; }
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}
.alert-success { background: #d4edda; color: var(--green-dark); }
.alert-error { background: #f8d7da; color: var(--red-dark); }
.alert-info { background: #d1ecf1; color: var(--blue-dark); }
.alert-warning { background: #fff3cd; color: #856404; }

/* Mobile Footer Nav - visible only on mobile */
.mobile-footer-nav { display: none; }
@media (max-width: 768px) {
    .mobile-footer-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--black);
        padding: 10px 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    .mobile-footer-nav .mfn-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: rgba(255,255,255,0.8);
        font-size: 0.7rem;
        text-decoration: none;
        padding: 4px 12px;
        transition: var(--transition);
    }
    .mobile-footer-nav .mfn-item:hover,
    .mobile-footer-nav .mfn-item.active { color: var(--orange); }
    .mobile-footer-nav .mfn-icon { display: flex; }
    .mobile-footer-nav .mfn-icon svg { width: 22px; height: 22px; }
    body.store-pages { padding-bottom: 70px; }
    body.customer-pages { padding-bottom: 70px; }
}

/* Footer */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 30px 0 15px;
    margin-top: 50px;
}
.footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* Store / Web Portal */
.store-main { padding: 30px 0 50px; min-height: 60vh; }
.store-hero { text-align: center; padding: 40px 20px; background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%); color: var(--white); border-radius: var(--border-radius); margin-bottom: 40px; }
.store-hero h1 { font-size: 1.8rem; margin-bottom: 10px; }
.store-hero p { opacity: 0.95; }

/* Product Banner Carousel */
.banner-carousel { margin: 0 -15px 40px; overflow: hidden; }
.carousel-wrap { position: relative; overflow: hidden; border-radius: var(--border-radius); }
.carousel-track { display: flex; transition: transform 0.5s ease; }
.carousel-slide { min-width: 100%; min-height: 200px; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; padding: 40px 20px; position: relative; background-size: cover; background-position: center; background-repeat: no-repeat; }
.carousel-slide::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.35); z-index: 0; }
.carousel-slide .slide-content { position: relative; z-index: 1; text-align: center; color: var(--white); display: flex; flex-direction: column; align-items: center; }
.carousel-slide .slide-banner-img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 3px solid rgba(255,255,255,0.8); margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.carousel-slide h2 { font-size: 1.5rem; margin-bottom: 10px; }
.carousel-slide p { margin-bottom: 15px; opacity: 0.95; }
.carousel-slide .btn { background: var(--white); color: var(--black); }
.carousel-slide .btn:hover { background: var(--orange); color: var(--white); }
.slide-1, .slide-2, .slide-3 { background-color: var(--gray-800); }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; background: rgba(255,255,255,0.9); color: var(--black); font-size: 28px; cursor: pointer; z-index: 2; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; transition: var(--transition); }
.carousel-btn:hover { background: var(--white); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-dots { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.carousel-dots .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--white); background: transparent; cursor: pointer; padding: 0; transition: var(--transition); }
.carousel-dots .dot:hover { background: rgba(255,255,255,0.5); }
.carousel-dots .dot.active { background: var(--white); }
@media (max-width: 768px) {
    .carousel-slide { min-height: 160px; padding: 30px 15px; background-size: cover; background-position: center; }
    .carousel-slide .slide-banner-img { width: 80px; height: 80px; margin-bottom: 10px; }
    .carousel-slide h2 { font-size: 1.2rem; }
    .carousel-slide p { font-size: 0.9rem; }
    .carousel-btn { width: 36px; height: 36px; font-size: 24px; }
    .carousel-prev { left: 5px; }
    .carousel-next { right: 5px; }
}

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.product-card { background: var(--white); border-radius: var(--border-radius); box-shadow: var(--shadow); overflow: hidden; transition: var(--transition); border: 1px solid var(--gray-200); }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.product-card a { display: block; padding: 15px; color: inherit; }
.product-card h3 { font-size: 1rem; margin-bottom: 8px; line-height: 1.3; }
.product-image { height: 120px; background: var(--gray-100); display: flex; align-items: center; justify-content: center; }
.product-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-image .no-img { color: var(--gray-600); font-size: 0.9rem; }
.product-price { color: var(--green); font-weight: 700; }
.product-sku { font-size: 0.85rem; color: var(--gray-600); }

.filter-bar { margin-bottom: 25px; }
.filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-form select { padding: 8px 12px; border-radius: var(--border-radius); min-width: 180px; }

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-detail-image { background: var(--gray-100); border-radius: var(--border-radius); min-height: 300px; display: flex; align-items: center; justify-content: center; }
.product-detail-image img { max-width: 100%; max-height: 300px; object-fit: contain; }
.product-detail-image .no-img.large { font-size: 3rem; color: var(--gray-600); }
.product-detail-info h1 { margin-bottom: 15px; }
.add-to-cart-form .form-group.inline { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.add-to-cart-form .form-group.inline label { margin-bottom: 0; }

.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-form input[type="text"] { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: var(--border-radius); }

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contact-info h3, .contact-form-wrap h3 { margin-bottom: 15px; }
.map-container { margin-top: 15px; border-radius: var(--border-radius); overflow: hidden; }
.contact-form-wrap { background: var(--gray-100); padding: 25px; border-radius: var(--border-radius); }

.cart-table { margin-bottom: 20px; }
.cart-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cart-total { font-size: 1.2rem; font-weight: 700; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.form-card { max-width: 600px; background: var(--white); padding: 25px; border-radius: var(--border-radius); box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-actions { display: flex; gap: 15px; margin-top: 20px; }

.page-content { padding: 30px 0; }
.page-content h1 { margin-bottom: 20px; }
.footer-links { display: flex; gap: 25px; margin-bottom: 15px; }
.footer-links a { color: var(--white); }

details { margin-bottom: 15px; border: 1px solid var(--gray-200); border-radius: var(--border-radius); padding: 12px 15px; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 10px; color: var(--gray-600); }

@media (max-width: 768px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .product-detail { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* Utilities */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mt-10 { margin-top: 10px; }

.order-customer-info { background: var(--gray-100); padding: 20px; border-radius: var(--border-radius); margin-bottom: 25px; }
.order-customer-info h2 { margin-bottom: 15px; font-size: 1.1rem; }
.order-customer-info p { margin-bottom: 8px; }
.order-total { margin-top: 15px; font-size: 1.2rem; }
.hidden { display: none !important; }
