* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Navbar - Mobile First Approach */
.navbar {
    background: #274F97;    
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    z-index: 1001;
}

.logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: #FFD700;
}   

.cart-icon {
    position: relative;
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main-content {
    margin-top: 80px;
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    color: #8B4513;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #8B4513;
    background: transparent;
    color: #8B4513;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: #8B4513;
    color: white;
}

/* Menu Items */
.category-section {
    margin-bottom: 4rem;
}

.category-title {
    color: #8B4513;
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, #8B4513, #D2691E);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.item-card {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: auto;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: #8B4513;
}

.item-image-container {
    width: 100%;
    height: 160px;
    position: relative;
    overflow: hidden;
}

.item-image {
    width: 100%;
    padding: 5px;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.item-card:hover .item-image {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 2rem;
}

.item-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.item-header {
    margin-bottom: 0.75rem;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.item-description {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #8B4513;
}

.stock-info {
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.stock-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.stock-low .stock-indicator {
    background: #ffc107;
}

.stock-out .stock-indicator {
    background: #dc3545;
}

.stock-low {
    color: #856404;
}

.stock-out {
    color: #721c24;
    font-weight: 600;
}

.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.quantity-btn {
    background: #f8f9fa;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    color: #666;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #e9ecef;
    color: #333;
}

.quantity-input {
    border: none;
    padding: 0.25rem;
    width: 30px;
    text-align: center;
    outline: none;
    font-size: 0.85rem;
    height: 28px;
}

.add-to-cart-btn {
    background: linear-gradient(135deg, #8B4513, #D2691E);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.add-to-cart-btn:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.add-to-cart-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s;
    z-index: 2000;
    overflow-y: auto;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    background: #8B4513;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #8B4513;
    font-weight: 500;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-total {
    padding: 1rem;
    border-top: 2px solid #8B4513;
    background: #f8f9fa;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: #8B4513;
    text-align: center;
    margin-bottom: 1rem;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.checkout-btn:hover {
    opacity: 0.9;
}

.empty-cart {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 3000;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    color: #8B4513;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.3s;
    margin-right: 0.5rem;
}

.btn-primary {
    background: #8B4513;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

/* Mobile Responsive Breakpoints */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .cart-sidebar {
        width: 350px;
    }
}

/* Tablets */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #274F97;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 2rem 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.1rem;
    }
    
    /* Main content adjustments */
    .main-content {
        margin-top: 70px;
        padding: 1.5rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .item-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .item-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .navbar {
        padding: 0.75rem 0;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo img {
        width: 35px;
        height: 35px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .main-content {
        margin-top: 65px;
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .category-filter {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .category-title {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .item-card {
        max-width: none;
    }
    
    .item-content {
        padding: 1rem;
    }
    
    .item-name {
        font-size: 1rem;
    }
    
    .item-description {
        font-size: 0.8rem;
    }
    
    .item-price {
        font-size: 1rem;
    }
    
    .add-to-cart-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1.5rem;
        width: 95%;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }
    
    .cart-header {
        padding: 0.75rem 1rem;
    }
    
    .cart-items {
        padding: 0.75rem;
    }
    
    .cart-item {
        padding: 0.75rem 0;
    }
    
    .cart-item img {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem;
    }
    
    .cart-item-name {
        font-size: 0.9rem;
    }
    
    .cart-item-price {
        font-size: 0.85rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo img {
        width: 30px;
        height: 30px;
        margin-right: 8px;
    }
    
    .container {
        padding: 0 8px;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .item-content {
        padding: 0.8rem;
    }
    
    .modal-content {
        padding: 1rem;
        width: 98%;
    }
}