/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
    --primary: #000000;
    --primary-hover: #222222;
    --primary-light: #f5f5f5;
    --secondary: #888888;
    --accent: #000000;
    --success: #000000;
    --danger: #000000;
    --background: #fafafa;
    --surface: #ffffff;
    --text-main: #111111;
    --text-muted: #666666;
    --border: #e5e5e5;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.04);
    --shadow: 0 4px 10px 0 rgba(0,0,0,.08);
    --radius: 4px;
    --app-width: 480px;
}

body.dark-theme {
    --background: #1a1625; /* Deep Purple Dark */
    --surface: #241e32;
    --text-main: #f0ecf2;
    --text-muted: #9f99a6;
    --border: #3d344a;
    --primary-light: #3d263d;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.5);
    --shadow: 0 4px 10px 0 rgba(0,0,0,.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Roboto', sans-serif; 
    background-color: #333; /* Dark background for desktop surrounding the mobile app */
    color: var(--text-main); 
    line-height: 1.4;
    transition: background 0.3s, color 0.3s;
}

/* App Shell Logic */
.app-shell {
    max-width: var(--app-width);
    margin: 0 auto;
    background-color: var(--background);
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Header Shopee Style - More Polished */
header {
    background: var(--primary); /* Shopee header is usually orange */
    height: 60px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.search-bar-sim {
    flex-grow: 1;
    background: white;
    height: 36px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
    color: var(--primary);
    font-size: 0.8125rem;
}

.search-bar-sim input {
    border: none;
    outline: none;
    width: 100%;
    color: var(--text-main);
}

.logo-header {
    color: white;
    font-weight: 900;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #fff;
}

.header-icon {
    color: #222222;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: #fff;
}

body.dark-theme header {
    background: #1e1e1e;
    border-bottom: 1px solid var(--border);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.theme-toggle:hover { background: var(--background); }

/* Homepage Specifics */
.hero-banner-container {
    width: 100%;
    aspect-ratio: 16/7;
    position: relative;
    overflow: hidden;
    background: var(--primary);
}

.hero-slider {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
    text-align: center;
}

.hero-content {
    z-index: 2;
    animation: fadeInSlideUp 0.6s ease-out forwards;
}

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-slide::before {
    content: '';
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.hero-slide::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

/* Carousel Indicators */
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transition: all 0.3s;
}

.dot.active {
    width: 18px;
    background: white;
    border-radius: 4px;
}

/* Product Cards Grid - Shopee style: 2 columns tiny gap */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.product-card:active { transform: scale(0.98); }

.product-image-wrapper {
    aspect-ratio: 1/1;
    position: relative;
    background: #eee;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 8px;
    flex-grow: 1;
}

.product-name {
    font-size: 0.8125rem;
    line-height: 1rem;
    height: 2rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    margin-bottom: 8px;
    color: var(--text-main);
}

.product-price-container {
    display: flex;
    flex-direction: column;
}

.price-discounted {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 500;
}

.price-original {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: line-through;
}

.badge-discount {
    background: #ffe9e4;
    color: var(--primary);
    font-size: 0.625rem;
    padding: 1px 4px;
    border: 1px solid var(--primary);
    border-radius: 1px;
    position: absolute;
    top: 5px;
    right: 5px;
}

.badge-sold-out {
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Detail Page Shopee Style */
.slider-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background: white;
}

body.dark-theme .slider-container { background: #000; }

.slides-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.slides {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Change to cover for full responsiveness */
}

.detail-info {
    padding: 16px;
    background: var(--surface);
    margin-bottom: 8px;
}

.detail-title {
    font-size: 1.125rem;
    font-weight: 400;
    margin-bottom: 12px;
}

.detail-price-box {
    background: var(--primary-light);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Fixed Bottom Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-width);
    background: var(--surface);
    display: flex;
    height: 50px;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.05);
    z-index: 1000;
}

.bottom-nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem !important;
    color: var(--text-main);
    flex: 1;
    height: 100%;
}

.bottom-nav-item i {
    margin: 0;
}

.btn-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 500;
    font-size: 0.75rem !important;
}

.btn-chatwhatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    background: #25D366;
    color: white;
    border: none;
    font-weight: 500;
    font-size: 0.75rem !important;
}

/* Modal CSS */
.modal {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--app-width);
    background: var(--surface);
    z-index: 2000;
    padding: 16px;
    border-radius: 12px 12px 0 0;
    display: none;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); }
    to { transform: translate(-50%, 0); }
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
}

/* Utility */
.mb-2 { margin-bottom: 8px; }
.text-primary { color: var(--primary); }

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}


/* User Profile Badge */
.user-badge {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
}

body.dark-theme .user-badge {
    background: #1e293b;
    border-color: #334155;
}


.user-badge span {
    font-weight: 600;
    font-size: 0.875rem;
}

@media (min-width: 260px) and (max-width: 670px) {
    .app-shell {
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        box-shadow: none;
    }
    
    .mobile-hide {
        display: none !important;
    }
}
