/* Quick Kebab NEJMA - Global Styles */

:root {
    --primary-color: #D61F26;
    --primary-dark: #B91C23;
    --secondary-color: #0B0B0B;
    --accent-color: #FF4D4D;
    --background-color: #F6F7FB;
    --text-color: #1A1A1A;
    --text-muted: #6B7280;
    --white: #FFFFFF;
    --border-radius: 12px;
    --font-family: 'Outfit', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-primary { color: var(--primary-color); }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
    position: relative;
}

/* Header */
.app-header {
    background-color: var(--white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-weight: bold;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: var(--white);
    padding: 2rem 1rem;
    text-align: center;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    margin-bottom: 1.5rem;
}

.hero h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.hero .text-primary {
    color: var(--accent-color);
}

/* Navigation */
.category-nav {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 1rem;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.category-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.cat-btn {
    background-color: var(--white);
    border: 1px solid #e5e7eb;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.cat-btn.active, .cat-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

/* Product Grid */
#product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Responsive grid */
    gap: 1rem;
    padding-bottom: 5rem; /* Space for FAB or footer */
}

.product-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    width: 100%;
    height: 120px;
    object-fit: cover; /* Maintain aspect ratio */
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background-color: #f3f4f6; /* Placeholder color */
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--secondary-color);
}

.product-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.btn-add {
    background-color: var(--secondary-color);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%; /* Circle button */
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Mobile: slide up from bottom */
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--white);
    width: 100%;
    max-width: 500px; /* Tablet limit */
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 1.5rem;
    animation: slideUp 0.3s ease-out;
    max-height: 90vh; /* Don't cover full screen */
    overflow-y: auto;
    position: relative;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.model-container {
    height: 250px; /* Space for 3D model */
    background-color: #f9fafb;
    border-radius: 16px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

model-viewer {
    width: 100%;
    height: 100%;
}

.options-group {
    margin: 1rem 0;
}

.options-group label {
    display: block;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    align-items: center;
}

.qty-control {
    display: flex;
    align-items: center;
    background-color: #f3f4f6;
    border-radius: 8px;
    padding: 0.25rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

#qty-val {
    width: 40px;
    text-align: center;
    font-weight: 600;
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Desktop Responsive Adjustments */
@media (min-width: 768px) {
    .modal {
        align-items: center; /* Center modal on desktop */
    }
    .modal-content {
        border-radius: 24px; /* Fully rounded on desktop */
        max-width: 600px;
    }
    #product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
