@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=Inter:wght@400;700;900&display=swap');

:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #e11d48; /* Industrial Rose/Red */
    --accent-hover: #be123c;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Outfit', sans-serif; 
    background: var(--bg-main); 
    color: var(--text-main); 
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3 { font-family: 'Inter', sans-serif; font-weight: 900; letter-spacing: -0.025em; }

/* Navigation */
.navbar {
    background: var(--primary);
    color: var(--white);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}
.navbar .logo { font-size: 1.5rem; letter-spacing: 2px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-btn { color: var(--white); text-decoration: none; font-weight: 600; cursor: pointer; font-size: 0.9rem; }
.nav-btn:hover { color: var(--accent); }
.nav-btn.active-link { color: var(--accent); border-bottom: 2px solid var(--accent); }

/* Hero Section */
.hero {
    height: 40vh;
    background: linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)), url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&q=80&w=2000');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--white);
    text-align: center;
    padding: 2rem;
}
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; text-transform: uppercase; }

/* Grid Layout */
.container { max-width: 1300px; margin: 3rem auto; padding: 0 2rem; }
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

/* Product Card */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    position: relative; /* CRITICAL FIX */
    border: 1px solid rgba(0,0,0,0.05);
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.card-img-container {
    height: 220px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}
.card-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.card:hover img { transform: scale(1.05); }

.card-body { padding: 1.5rem; }
.category-badge {
    background: var(--bg-main);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.card-title { margin: 0.5rem 0; font-size: 1.25rem; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #f1f5f9; padding-top: 1rem; }
.price { font-size: 1.5rem; font-weight: 900; color: var(--primary); }

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.modal-close { font-size: 2rem; cursor: pointer; color: var(--text-muted); }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 700; font-size: 0.9rem; color: var(--primary-light); }
.form-input { 
    width: 100%; 
    padding: 0.75rem 1rem; 
    border: 2px solid var(--bg-main); 
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Custom Dropdown Styling */
select.form-input {
    appearance: none;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
    cursor: pointer;
}
select.form-input:hover { border-color: #cbd5e1; }
select.form-input:focus { border-color: var(--accent); }

/* Color Selector Circles */
.color-selector { display: flex; gap: 10px; margin-top: 5px; }
.color-dot {
    width: 26px; height: 26px; border-radius: 50%;
    cursor: pointer; border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.color-dot:hover { transform: scale(1.15); border-color: var(--text-muted); }
.color-dot.active { 
    transform: scale(1.25); 
    border-color: var(--primary); 
    box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--primary);
}

/* Admin Specifics */
.admin-card { border-left: 4px solid var(--accent); }
.admin-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 0.6rem; z-index: 100; }
.action-btn { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border: 1px solid #eee; color: var(--text-muted); transition: all 0.2s; }
.action-btn:hover { background: var(--white); color: var(--accent); transform: scale(1.1); }
.action-btn i { font-size: 0.9rem; }
.action-btn.active { color: var(--accent); border-color: var(--accent); }

/* Toast Notifications */
.toast {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 280px;
    border-left: 4px solid var(--accent);
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--primary);
    font-weight: 600;
}
.toast.success { border-left-color: #10b981; }
.toast.success i { color: #10b981; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
    animation: fadeOut 0.4s forwards;
}

@keyframes fadeOut {
    to { transform: translateY(-20px); opacity: 0; }
}
.cart-drawer {
    position: fixed;
    right: -450px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: var(--white);
    z-index: 1500;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.cart-drawer.active { right: 0; }
.cart-header { padding: 1.5rem; background: var(--primary); color: var(--white); display: flex; justify-content: space-between; }
.cart-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.cart-footer { padding: 1.5rem; border-top: 1px solid #f1f5f9; }

/* Responsive */
@media (max-width: 768px) {
    .grid { grid-template-columns: 1fr; }
    .cart-drawer { width: 100%; right: -100%; }
    .modal { padding: 1.5rem; }
}

.hidden { display: none !important; }
.tech-spec { 
    font-size: 0.7rem; 
    color: var(--primary); 
    background: #f8fafc; 
    padding: 4px 10px; 
    border-radius: 6px; 
    margin-right: 8px; 
    display: inline-block; 
    margin-top: 8px; 
    border: 1px solid #e2e8f0;
    font-weight: 600;
    letter-spacing: 0.025em;
}

/* Custom Dropdown Component */
.custom-dropdown { position: relative; width: 220px; z-index: 1100; }
.dropdown-trigger {
    background: var(--white);
    border: 2px solid #e2e8f0;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.85rem; font-weight: 700; transition: all 0.2s;
    color: var(--primary);
}
.dropdown-trigger:hover { border-color: var(--accent); }
.dropdown-trigger i { font-size: 0.7rem; transition: 0.3s; color: var(--text-muted); }
.custom-dropdown.active .dropdown-trigger i { transform: rotate(180deg); }
.custom-dropdown.active .dropdown-trigger { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.05); }

.dropdown-menu {
    position: absolute; top: calc(100% + 6px); left: 0; width: 100%;
    background: var(--white); border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    border: 1px solid #f1f5f9;
    display: none; overflow: hidden;
    animation: slideDown 0.2s ease-out;
}
.custom-dropdown.active .dropdown-menu { display: block; }

.dropdown-item {
    padding: 0.8rem 1.2rem; cursor: pointer; transition: 0.2s; font-size: 0.85rem; font-weight: 600; color: var(--primary-light);
}
.dropdown-item:hover { background: var(--bg-main); color: var(--accent); padding-left: 1.5rem; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Category Chips */
.filter-chips {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
    padding: 0.6rem 1.25rem;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-muted);
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: rgba(225, 29, 72, 0.02); }
.chip.active { background: var(--accent); color: var(--white); border-color: var(--accent); box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25); }
