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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --background: #fdfdfd;
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #f1f5f9;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --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-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* Layout Containers */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(15px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-item {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9rem;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--border);
}

/* Hero Section */
.hero {
    position: relative;
    padding: 120px 0 160px;
    background: radial-gradient(circle at top right, #eef2ff 0%, #ffffff 50%);
    overflow: hidden;
    margin-bottom: -40px;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--background));
}

.hero-content {
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
}

.hero h1 {
    font-size: 4.5rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -3px;
    margin-bottom: 24px;
    color: var(--secondary);
}

.hero h1 mark {
    background: none;
    color: var(--primary);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Grid Layouts */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1.5px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

/* Product Card - REFINED */
.product-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.product-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: #f8fafc;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.product-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.05);
}

.product-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.product-details {
    padding: 0 4px;
}

.product-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.price-tag {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.add-btn {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.add-btn:hover {
    background: var(--secondary);
}

/* Panel Styling (Admin/Vendor) */
.panel-grid {
    display: flex;
    min-height: 100vh;
}

.panel-sidebar {
    width: 280px;
    background: var(--secondary);
    color: #e2e8f0;
    padding: 32px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.panel-main {
    flex: 1;
    background: #f8fafc;
    padding: 48px;
    min-width: 0;
}

/* Sidebar active on mobile */
@media (max-width: 768px) {
    .panel-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
    }
    .panel-sidebar.active {
        transform: translateX(0);
    }
    .panel-main {
        padding: 24px 20px;
    }
}

.d-md-none { display: none !important; }
@media (max-width: 768px) {
    .d-md-none { display: flex !important; }
    .d-none-mobile { display: none !important; }
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #94a3b8;
}

.menu-link:hover, .menu-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border);
}

/* Forms - IMPROVED */
.input-field {
    width: 100%;
    padding: 14px 20px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    transition: 0.2s;
    font-size: 1rem;
}

.input-field:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--secondary);
}

/* Footer refined */
footer {
    padding: 80px 0 48px;
    background: var(--secondary);
    color: #94a3b8;
    margin-top: 120px;
}

/* =============================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ============================================= */

@media (max-width: 1024px) {
    .hero h1 { font-size: 3.5rem; letter-spacing: -2px; }
    .panel-sidebar { width: 220px; }
    .panel-main { padding: 32px; }
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }
    
    /* Premium Mobile Header */
    header { height: auto; padding: 12px 0; }
    .nav-wrapper { height: auto; padding: 0; flex-direction: column; justify-content: center; gap: 16px; }
    .nav-links { display: flex; width: 100%; flex-wrap: wrap; justify-content: center; gap: 12px; }
    .nav-item { font-size: 0.85rem; padding: 6px; }
    .btn { padding: 8px 16px; font-size: 0.85rem; }

    /* Hero Refinement */
    .hero { padding: 60px 0 80px; margin-bottom: 0; }
    .hero h1 { font-size: 2.2rem; letter-spacing: -2px; }
    .hero p { font-size: 1rem; }
    
    /* Force 2 Columns on Mobile for better density */
    .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .product-card { padding: 10px; border-radius: 20px; }
    .product-name { font-size: 0.95rem; margin-bottom: 8px; }
    .product-meta { font-size: 0.75rem; }
    .price-tag { font-size: 1.1rem; }
    .add-btn { width: 36px; height: 36px; border-radius: 10px; }
    
    /* Footer & Page Adjustments */
    main { padding-bottom: 40px; }
    .section-title { font-size: 1.6rem; }
    .card { padding: 20px; border-radius: 24px; }
}

/* =============================================
   UNIVERSAL RESPONSIVE UTILITIES
   ============================================= */
.responsive-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

/* Grid Utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-sidebar { display: grid; grid-template-columns: 280px 1fr; gap: 40px; }

/* Desktop overrides / Tablet fixes */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-sidebar { grid-template-columns: 220px 1fr; gap: 24px; }
}

@media (max-width: 992px) {
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4, .grid-sidebar {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .panel-grid {
        flex-direction: column;
    }
    .panel-sidebar {
        width: 100%;
        height: auto;
        padding: 20px;
        position: relative;
    }
    
    footer .container.grid-4 {
        margin-bottom: 30px !important;
    }
    
    .profile-header .container {
        flex-direction: column;
        text-align: center;
    }
}

body {
    overflow-x: hidden;
    width: 100%;
}

.card {
    max-width: 100%;
    box-sizing: border-box;
}

table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}
