/* Alaabso Design System - Temu Inspired */
:root {
    --primary: #fb641b;
    /* Temu Orange */
    --primary-dark: #e1550c;
    --secondary: #2874f0;
    /* Action Blue */
    --bg-light: #f1f3f6;
    --white: #ffffff;
    --text-main: #212121;
    --text-muted: #878787;
    --success: #388e3c;
    --danger: #ff6161;
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, .08);
    --shadow-md: 0 4px 16px 0 rgba(0, 0, 0, .1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --max-width: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-bar {
    flex: 1;
    margin: 0 2rem;
    display: flex;
    background: #f0f5ff;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    background: transparent;
    outline: none;
}

.search-bar button {
    background: var(--primary);
    border: none;
    color: var(--white);
    padding: 0 1.5rem;
    cursor: pointer;
}

/* Category Slider */
.categories-nav {
    background: var(--white);
    padding: 1rem 0;
    margin-bottom: 1rem;
    overflow-x: auto;
    white-space: nowrap;
}

.category-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-right: 2rem;
    cursor: pointer;
}

.category-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fdfdfd;
    margin-bottom: 0.5rem;
    object-fit: cover;
    border: 1px solid #eee;
    transition: border-color 0.3s, transform 0.3s;
}

.category-item.active .category-img {
    border-color: var(--primary);
    border-width: 2px;
    transform: scale(1.05);
}

.category-item span {
    font-size: 0.8rem;
    color: var(--text-main);
}

.category-item.active span {
    color: var(--primary);
    font-weight: 700;
}

/* Smart Shortcuts */
.smart-shortcuts {
    margin: 1rem 0;
    overflow: hidden;
}

.shortcut-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.shortcut-scroll::-webkit-scrollbar {
    display: none;
}

.shortcut-btn {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid #ddd;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.shortcut-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.shortcut-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    /* Added default shadow as requested */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-img-wrapper {
    position: relative;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
}

.product-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 0.75rem;
}

.product-name {
    font-size: 0.875rem;
    height: 2.5rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.product-price {
    color: var(--text-main);
    font-size: 1.125rem;
    font-weight: 700;
}

.product-price small {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 0.5rem;
}

/* WhatsApp Button */
.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #25D366;
    color: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-weight: bold;
    margin-top: 1rem;
    width: 100%;
}

/* Notifications */
.cart-badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    position: absolute;
    top: -5px;
    right: -10px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        width: 100%;
        margin: 1rem 0 0;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Modal Styles - MANDATORY TO HIDE CHECKOUT FORM */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    /* Crucial: hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-header h2 {
    color: var(--primary);
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Floating Cart */
.floating-cart {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-cart:hover {
    transform: scale(1.1) rotate(-5deg);
    background: var(--primary-dark);
}

.floating-cart .cart-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border: 2px solid white;
    border-radius: 12px;
}

/* Floating WhatsApp */
.floating-whatsapp {
    position: fixed;
    top: 40vh;
    /* 10% above mid-screen */
    right: 2rem;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: scale(0);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 2s forwards;
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.floating-whatsapp:hover {
    transform: scale(1.1);
    background: #128C7E;
}