@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600&family=Playfair+Display:wght@400;700&display=swap');

:root {
    --primary-color: #d66a87;
    --primary-color-dark: #b84c69;
    --secondary-color: #f8e1e7;
    --accent-color: #bf5570;
    --accent-color-dark: #a1405a;
    --text-color: #333;
    --bg-color: #fffaf0;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --glass: rgba(255, 255, 255, 0.8);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Glassmorphism utility */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

/* Layout & Header Classes from index.php */
.main-header {
    padding: 1rem 0;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    height: 60px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    width: 250px;
}

.search-form button {
    padding: 10px 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-accent:hover {
    background-color: var(--accent-color-dark);
    transform: translateY(-2px);
}

/* ===== ADMIN PANEL ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 2rem;
    flex-shrink: 0;
}

.sidebar-logo {
    margin-bottom: 2rem;
}

.sidebar-logo img {
    width: 100%;
    filter: brightness(0) invert(1);
}

.sidebar nav li {
    margin-bottom: 0.8rem;
}

.sidebar nav a {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--white);
    font-size: 0.95rem;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.main-content {
    flex: 1;
    padding: 2rem;
    background-color: #f4f4f4;
    min-width: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-form-panel {
    padding: 2rem;
    max-width: 800px;
}

.product-actions {
    margin-top: 1rem;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.75rem;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.success-message {
    background: #27ae60;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Admin Product Cards */
.admin-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Frontend Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.product-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.product-item h3, .product-card h3, .product-info h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

textarea.form-control {
    height: 120px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    animation: fadeIn 0.5s ease-out forwards;
}

@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .container { width: 98%; padding: 0 5px; }
    
    header .container {
        padding: 5px 15px;
        flex-wrap: wrap;
    }

    /* Mobile Header */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        z-index: 1000;
    }

    .menu-toggle span {
        width: 25px;
        height: 3px;
        background: var(--primary-color);
        transition: var(--transition);
    }

    header nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--white);
        padding-top: 80px;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 999;
    }

    header nav.active {
        right: 0;
    }

    header nav ul {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .hero {
        height: 45vh;
        padding: 1.5rem 0;
    }

    .hero h1 { 
        font-size: 2rem; 
        padding: 0 10px;
    }

    /* ===== ADMIN MOBILE ===== */
    .admin-layout {
        flex-direction: column;
    }

    .sidebar { 
        width: 100% !important;
        padding: 1rem 1.5rem;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    .sidebar-logo {
        flex-shrink: 0;
        margin-bottom: 0 !important;
    }
    
    .sidebar-logo img {
        width: 100px !important;
        filter: brightness(0) invert(1);
    }

    .sidebar nav {
        flex: 1;
    }

    .sidebar nav ul {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .sidebar nav li {
        margin-bottom: 0;
    }

    .sidebar nav a {
        padding: 6px 12px;
        font-size: 0.85rem;
        text-align: center;
        white-space: nowrap;
    }

    .main-content {
        padding: 1rem;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-header .btn {
        width: 100%;
        text-align: center;
    }

    .admin-form-panel {
        padding: 1.5rem;
    }

    .admin-products {
        grid-template-columns: 1fr !important;
    }

    .admin-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cart-modal { 
        width: 100vw; 
        right: -100vw; 
    }

    /* Filter Bar Fix */
    .filter-bar { 
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .product-info {
        padding: 8px;
    }

    .product-card img {
        height: 150px;
    }

    .product-card h3 {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }

    .product-card .product-price {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .product-card .btn {
        padding: 8px;
        font-size: 0.7rem;
    }
    
    .categories-chips { 
        display: flex;
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding-bottom: 15px;
        width: 100%;
        scrollbar-width: none;
    }
    
    .categories-chips::-webkit-scrollbar {
        display: none;
    }

    .categories-chips a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .search-form {
        width: 100%;
        flex-direction: column;
    }

    .search-form input {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .search-form button {
        width: 100%;
    }
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    color: var(--primary-color);
}
