/**
 * Superindo Taiwan - Core CSS
 * Brand Colors: Red + Yellow
 */

/* === CSS Variables === */
:root {
    --primary: #E31E24;
    --primary-dark: #c41a1f;
    --primary-light: #FEE7E7;
    --secondary: #FFD100;
    --secondary-dark: #E6BC00;
    --secondary-light: #FFF9E0;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E5E5E5;
    --gray-300: #D4D4D4;
    --gray-400: #A3A3A3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.05), 0 4px 6px rgba(0,0,0,0.03);
    
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;
    
    --header-height: 88px;
    --footer-height: 70px;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

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

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-800);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary {
    padding: 0.3rem 0.7rem;
    background: var(--primary);
    color: white;
    border: 1.5px solid var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--gray-800);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-dark);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-600);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-outline-primary {
    padding: 0.3rem 0.7rem;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 500;
    background: transparent;
    transition: all 0.2s;
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* === Forms === */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--gray-400);
}

/* === Top Bar === */
.top-bar {
    background: var(--primary);
    padding: 0.375rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    width: 100%;
}

.top-bar-inner {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.top-bar-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    overflow: hidden;
}

.top-bar-left > i {
    color: white;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.marquee-wrapper {
    flex: 1;
    overflow: hidden;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 0;
    animation: marquee 20s linear 3s infinite;
}

.marquee-content span {
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.marquee-wrapper:hover .marquee-content {
    animation-play-state: paused;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.top-bar-right .top-link {
    color: rgba(255,255,255,0.9);
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s;
}

.top-bar-right .top-link:hover {
    color: white;
}

.top-bar-right .top-link i {
    margin-right: 0.25rem;
}

.top-bar-right .separator {
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
}

/* === Main Header === */
.main-header {
    width: 100%;
    position: fixed;
    top: 28px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0.75rem 0.5rem 0.75rem;
}

.header-inner {
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* === Brand Logo === */
.brand-logo {
    flex-shrink: 0;
}

.brand-logo img {
    height: 38px;
    width: auto;
}

/* === Search Box === */
.search-box {
    flex: 1;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--white);
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

/* === Header Actions === */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}

.cart-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    position: relative;
    border-radius: var(--radius);
    transition: all 0.2s;
    font-size: 1.125rem;
}

.cart-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.cart-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
}

/* === Bottom Navigation === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.375rem 1rem;
    color: var(--gray-400);
    font-size: 0.6875rem;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

/* === Main Content === */
.main-content {
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
    min-height: 100vh;
    background: var(--gray-50);
}

.main-content.no-header {
    padding-top: 0;
}

.main-content.no-footer {
    padding-bottom: 0;
}

/* === Cards === */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-body {
    padding: 1.25rem;
}

/* === Utilities === */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-200);
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray-400);
}

/* === Responsive === */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0.25rem 1rem;
    }
    
    .top-bar-left span,
    .top-bar-right .location {
        font-size: 0.6875rem;
    }
    
    .main-header {
        top: 24px;
        padding: 0.625rem 1rem;
    }
    
    .header-inner {
        margin-top:10px;
        gap: 0.75rem;
    }
    
    .brand-logo img {
        height: 32px;
    }
    
    .header-actions .btn-outline-primary,
    .header-actions .btn-primary {
        display: none;
    }
    
    .search-box input {
        padding: 0.5rem 1rem 0.5rem 2.5rem;
        font-size: 0.8125rem;
    }
    
    :root {
        --header-height: 80px;
    }
}