/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #ff8c00;
    --color-primary-hover: #e67e00;
    --color-dark-navy: #1a1a2e;
    --color-dark-gray: #16213e;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-light-gray: #f8f9fa;
    --color-border: #e1e5e9;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-light-gray);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
}

.container-wide {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
}

/* Full width responsive adjustments */
@media (max-width: 768px) {
    .container,
    .container-wide {
        padding: 0 20px;
    }
}

.main-content {
    flex: 1;
}

/* ===== Mobile Menu Burger & Sidebar (Amazon Style) ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    background: transparent;
    border: none;
    width: 50px;
    height: 60px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:active {
    opacity: 0.7;
}

/* Animated burger to X on open */
.mobile-sidebar.open ~ .mobile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.mobile-sidebar.open ~ .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
}

.mobile-sidebar.open ~ .mobile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 1002;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.mobile-sidebar.open {
    left: 0;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--color-dark-navy);
    border-bottom: 1px solid #ddd;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.mobile-logo i {
    font-size: 24px;
    color: var(--color-primary);
}

.mobile-logo span {
    color: var(--color-primary);
}

.mobile-sidebar-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.mobile-sidebar-content {
    padding: 0;
}

.mobile-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.mobile-user-section i {
    font-size: 36px;
    color: var(--color-primary);
}

.mobile-user-section div {
    display: flex;
    flex-direction: column;
}

.mobile-user-section strong {
    font-size: 14px;
    color: #111;
}

.mobile-user-section span {
    font-size: 12px;
    color: #565959;
}

.mobile-nav {
    padding: 0;
}

.mobile-nav-section {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.mobile-nav-section h4 {
    font-size: 12px;
    color: #565959;
    text-transform: uppercase;
    margin: 0 20px 10px;
    font-weight: 600;
}

.mobile-nav-section a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.mobile-nav-section a:hover {
    background: #f5f5f5;
}

.mobile-nav-section a i {
    font-size: 16px;
    color: var(--color-primary);
    width: 20px;
    text-align: center;
}

.mobile-badge {
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.mobile-logout {
    color: #B12704 !important;
}

.mobile-logout i {
    color: #B12704 !important;
}

.mobile-login-btn,
.mobile-register-btn {
    margin: 0 20px;
    padding: 10px 15px !important;
    text-align: center;
    border-radius: 5px;
    font-weight: 600;
}

.mobile-login-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
}

.mobile-register-btn {
    background: var(--color-primary);
    color: #fff !important;
}

.mobile-register-btn i {
    color: #fff !important;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}

.mobile-sidebar-overlay.show {
    display: block;
}

/* ===== Header Styles ===== */
/* Note: Header styles are now defined inline in includes/header.php using .amazon-header classes */
/* These legacy styles have been removed to ensure consistency across all pages */

/* .main-nav styles removed - using .amazon-header-nav from header.php instead */

/* ===== Footer Styles ===== */
.site-footer {
    background: var(--color-dark-navy);
    color: var(--color-white);
    padding: 40px 30px 15px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--color-primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 13px;
}

.footer-section ul li a:hover {
    color: var(--color-primary);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 15px;
    text-align: center;
    color: #ccc;
    font-size: 12px;
}

.footer-bottom a {
    color: #ccc;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--color-primary);
}

/* ===== Button Styles ===== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: var(--color-white);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* ===== Alert Styles ===== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-color: var(--color-success);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: var(--color-danger);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--color-warning);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--color-info);
    color: #0c5460;
}

/* ===== Card Styles ===== */
.card {
    background: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 2px solid var(--color-light-gray);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }
.gap-3 { gap: 30px; }

/* Warehouse Name Links - Global Style */
.warehouse-name,
.warehouse-link,
a.warehouse-name,
a.warehouse-link {
    color: #007185;
    text-decoration: none;
    font-weight: 500;
}

.warehouse-name:hover,
.warehouse-link:hover,
a.warehouse-name:hover,
a.warehouse-link:hover {
    color: #C7511F;
    text-decoration: underline;
}

/* Account Dropdown */
.account-dropdown-wrapper {
    position: relative;
}

.account-dropdown-toggle {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #111;
    cursor: pointer;
    padding: 5px;
}

.account-dropdown-toggle i {
    font-size: 24px;
}

.account-dropdown-toggle span {
    font-size: 11px;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 250px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.account-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-dropdown-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background: #f8f8f8;
}

.account-dropdown-header strong {
    display: block;
    font-size: 15px;
    color: #111;
    margin-bottom: 4px;
}

.account-dropdown-header small {
    font-size: 12px;
    color: #565959;
}

.account-dropdown-menu {
    padding: 8px 0;
}

.account-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #111;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.account-dropdown-menu a:hover {
    background: #f0f0f0;
}

.account-dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: #565959;
}

.dropdown-divider {
    height: 1px;
    background: #ddd;
    margin: 8px 0;
}

/* ===== Mobile Header Responsive (Amazon Style) ===== */
/* Note: Mobile header styles are now defined inline in includes/header.php */
@media (max-width: 768px) {
    /* Show mobile burger menu */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Hide main navigation on mobile */
    .main-nav {
        display: none;
    }
    
    /* Cart badge - cleaner style */
    .cart-badge {
        width: 22px;
        height: 22px;
        font-size: 12px;
        top: 10px;
        right: 4px;
        font-weight: 700;
        background: #FF9900;
        color: #111;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Search bar - darker design */
    .search-bar {
        order: 10;
        flex: 1 1 100%;
        max-width: 100%;
        margin: 0;
        background: #37475A;
        padding: 10px 12px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .search-bar form {
        position: relative;
        max-width: 100%;
        display: flex;
    }
    
    .search-bar input {
        font-size: 15px;
        padding: 11px 50px 11px 14px;
        border-radius: 6px;
        border: none;
        background: #fff;
        flex: 1;
        transition: all 0.2s;
    }
    
    .search-bar input:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.3);
    }
    
    .search-bar button {
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        padding: 8px 14px;
        font-size: 16px;
        border-radius: 4px;
        background: #FF9900;
        color: #fff;
        border: none;
        transition: background 0.2s;
    }
    
    .search-bar button:hover {
        background: #e68a00;
    }
    
    .search-bar button i {
        font-size: 16px;
        color: #fff;
    }
    
    /* Location Dropdown - Bottom sheet style */
    .location-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
        overflow-y: auto;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    }
    
    /* Footer */
    .site-footer {
        display: none !important;
    }
    
    /* Show mobile bottom nav on mobile */
    .mobile-bottom-nav {
        display: flex !important;
    }
    
    /* Add padding to body to prevent content from being hidden behind bottom nav */
    body {
        padding-bottom: 70px;
    }
}

/* ===== Mobile Bottom Navigation ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    height: 60px;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.mobile-bottom-nav {
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 0;
}

.mobile-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #565959;
    font-size: 10px;
    padding: 8px 4px;
    transition: all 0.2s;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.mobile-bottom-nav .nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.mobile-bottom-nav .nav-item.active {
    color: #007185;
}

.mobile-bottom-nav .nav-item:active {
    background: #f0f0f0;
}

/* Extra small screens */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        width: 45px;
        height: 55px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
    }
    
    .mobile-sidebar {
        width: 85%;
        left: -85%;
    }
    
    .header-main {
        min-height: 55px;
    }
    
    .logo {
        font-size: 24px;
        margin-left: 45px;
        padding: 10px 14px;
    }
    
    .logo i {
        font-size: 28px;
    }
    
    .search-bar {
        padding: 8px 10px;
    }
    
    .search-bar input {
        font-size: 14px;
        padding: 10px 48px 10px 12px;
    }
    
    .search-bar button {
        padding: 7px 12px;
        right: 10px;
    }
    
    .header-actions {
        height: 55px;
    }
    
    .header-action {
        height: 55px;
        padding: 0 12px;
    }
    
    .header-action i {
        font-size: 22px;
    }
    
    .cart-badge {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

/* ===== Additional Mobile Optimizations ===== */

/* Tablets (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* General Mobile Improvements */
@media (max-width: 768px) {
    /* Typography */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 24px !important;
    }
    
    h2 {
        font-size: 20px !important;
    }
    
    h3 {
        font-size: 18px !important;
    }
    
    /* Cards */
    .card {
        padding: 20px;
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .card-title {
        font-size: 20px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 16px;
        border-radius: 6px;
    }
    
    select.form-control {
        min-height: 44px;
    }
    
    textarea.form-control {
        min-height: 120px;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
        border-radius: 6px;
        width: 100%;
    }
    
    .btn-sm {
        padding: 8px 14px;
        font-size: 14px;
        min-height: 38px;
    }
    
    .btn-block {
        width: 100%;
    }
    
    /* Alerts */
    .alert {
        padding: 12px 15px;
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    /* Tables - Make responsive */
    table {
        width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table thead {
        display: none;
    }
    
    table tbody {
        display: block;
    }
    
    table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background: white;
    }
    
    table td {
        display: block;
        text-align: left;
        padding: 8px 10px;
        border: none;
        position: relative;
        padding-left: 50%;
    }
    
    table td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: 600;
        color: #666;
    }
    
    /* Utility Classes - Mobile Specific */
    .d-flex {
        flex-wrap: wrap;
    }
    
    .gap-1, .gap-2, .gap-3 {
        gap: 10px;
    }
    
    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
    
    /* Text alignment */
    .text-center-mobile {
        text-align: center;
    }
    
    /* Spacing utilities for mobile */
    .mt-mobile-1 { margin-top: 10px !important; }
    .mt-mobile-2 { margin-top: 20px !important; }
    .mb-mobile-1 { margin-bottom: 10px !important; }
    .mb-mobile-2 { margin-bottom: 20px !important; }
    .px-mobile-0 { padding-left: 0 !important; padding-right: 0 !important; }
    .py-mobile-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
}

/* Extra small mobile (< 375px) */
@media (max-width: 374px) {
    .container {
        padding: 0 10px;
    }
    
    .card {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    h1 {
        font-size: 20px !important;
    }
    
    h2 {
        font-size: 18px !important;
    }
}

/* ===== Dashboard Link Styles ===== */
.manage-warehouse-link,
.view-all-link,
.add-products-link,
.manage-link {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.manage-warehouse-link:hover,
.view-all-link:hover,
.add-products-link:hover,
.manage-link:hover {
    color: #666;
    text-decoration: underline;
}
