* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e23744;
    --secondary: #ff6b35;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --success: #28a745;
    --warning: #ffc107;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background: var(--primary);
    color: white;
    padding: 8px 0;
    font-size: 14px;
    text-align: center;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    flex-wrap: wrap;
}

.logo h1 {
    color: var(--primary);
    font-size: 28px;
}

.logo p {
    font-size: 12px;
    color: #666;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 24px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    min-width: 20px;
    text-align: center;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 80px 5%;
    text-align: center;
    position: relative;
}

.hero h1 {
    font-size: 52px;
    color: var(--dark);
    margin-bottom: 20px;
    font-family: 'Playfair Display', serif;
}

.hero p {
    font-size: 20px;
    color: #555;
    margin-bottom: 30px;
}

.hero small {
    display: block;
    margin-top: 30px;
    font-size: 18px;
    color: var(--primary);
    font-weight: bold;
}

/* Categories Section */
.categories-section {
    padding: 60px 5%;
    background: #fff;
}

.section-title {
    text-align: center;
    font-size: 42px;
    margin-bottom: 50px;
    color: var(--dark);
    font-family: 'Playfair Display', serif;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    text-align: center;
    padding: 20px;
    background: var(--light);
    border-radius: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.category-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

.category-card h3 {
    margin-top: 15px;
    font-size: 16px;
}

/* Products Grid */
.products-section {
    padding: 60px 5%;
    background: var(--light);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark);
    font-weight: 600;
}

.product-price {
    font-size: 24px;
    color: var(--primary);
    font-weight: bold;
    margin: 10px 0;
}

.product-mrp {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-left: 10px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s;
    font-size: 14px;
    font-weight: 600;
}

.btn:hover {
    background: #c82333;
}

.btn-secondary {
    background: var(--secondary);
}

.btn-secondary:hover {
    background: #e55a2b;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Cart Page */
.cart-container {
    padding: 40px 5%;
    min-height: 60vh;
    max-width: 1200px;
    margin: 0 auto;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
    vertical-align: middle;
}

.quantity-input {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.cart-summary {
    margin-top: 30px;
    padding: 25px;
    background: var(--light);
    border-radius: 10px;
    max-width: 400px;
    margin-left: auto;
}

.cart-summary h3 {
    margin-bottom: 20px;
}

.cart-summary p {
    margin: 10px 0;
    font-size: 18px;
}

.total-amount {
    font-size: 24px;
    color: var(--primary);
    font-weight: bold;
}

/* Checkout */
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* QR Payment */
.qr-container {
    text-align: center;
    padding: 40px;
    background: var(--light);
    border-radius: 10px;
    max-width: 600px;
    margin: 40px auto;
}

.qr-image {
    max-width: 280px;
    margin: 20px auto;
}

.qr-image img {
    width: 100%;
    border-radius: 10px;
}

.payment-details {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
}

.payment-details p {
    margin: 10px 0;
}

.upload-area {
    border: 2px dashed #ddd;
    padding: 30px;
    margin-top: 20px;
    border-radius: 10px;
    background: white;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 50px 5% 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-section p {
    margin-bottom: 10px;
    color: #ccc;
    line-height: 1.8;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    max-width: 1200px;
    margin: 0 auto;
    color: #ccc;
    font-size: 14px;
}

/* Product Detail Page */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding: 40px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.product-main-image {
    width: 100%;
    border-radius: 10px;
}

.product-detail-info h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: var(--dark);
}

.product-detail-price {
    font-size: 32px;
    color: var(--primary);
    font-weight: bold;
    margin: 20px 0;
}

.product-detail-mrp {
    text-decoration: line-through;
    color: #999;
    font-size: 20px;
    margin-left: 15px;
}

.product-detail-description {
    margin: 20px 0;
    line-height: 1.8;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.quantity-selector input {
    width: 80px;
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .checkout-container,
    .product-detail-container {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
        width: 100%;
    }
    
    .cart-table thead {
        display: none;
    }
    
    .cart-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
    }
    
    .cart-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
    }
}

/* Admin Panel Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    padding: 20px;
}

.sidebar h3 {
    margin-bottom: 30px;
    text-align: center;
}

.sidebar a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 5px;
    transition: background 0.3s;
}

.sidebar a:hover {
    background: var(--primary);
}

.main-content {
    flex: 1;
    padding: 30px;
    background: #f5f5f5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
    margin-top: 10px;
}

.data-table {
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background: var(--primary);
    color: white;
}

.status-pending {
    background: #ffc107;
    color: #333;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.status-paid {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

/* Alert Messages */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   ADD THESE MOBILE RESPONSIVE STYLES
   ============================================ */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--dark);
}

/* Search Bar */
.search-icon {
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s;
}

.search-icon:hover {
    color: var(--primary);
}

.search-bar-container {
    padding: 15px 5%;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: none;
}

.search-bar-container form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: 10px;
}

.search-bar-container input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-bar-container button {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* ============================================
   IMPROVED MOBILE RESPONSIVE (768px AND BELOW)
   ============================================ */

@media (max-width: 768px) {
    /* Header Mobile */
    .main-header {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px 15px;
    }
    
    .logo {
        flex: 1;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .logo p {
        font-size: 9px;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 2;
    }
    
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        padding: 15px 0;
        order: 3;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-links li {
        width: 100%;
    }
    
    .nav-links a {
        display: block;
        padding: 10px;
        text-align: center;
        background: #f5f5f5;
        border-radius: 5px;
    }
    
    .header-icons {
        order: 1;
        gap: 15px;
    }
    
    .cart-icon {
        font-size: 20px;
    }
    
    .cart-count {
        top: -8px;
        right: -12px;
        font-size: 10px;
        padding: 1px 5px;
    }
    
    /* Hero Section Mobile */
    .hero {
        padding: 40px 20px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .hero small {
        font-size: 14px;
    }
    
    /* Section Title Mobile */
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    /* Category Grid Mobile */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-card {
        padding: 15px;
    }
    
    .category-card img {
        height: 120px;
    }
    
    .category-card h3 {
        font-size: 13px;
        margin-top: 10px;
    }
    
    /* Products Grid Mobile */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-image {
        height: auto;
        aspect-ratio: 1 / 1;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-title {
        font-size: 13px;
        margin-bottom: 5px;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .product-price {
        font-size: 16px;
        margin: 5px 0;
    }
    
    .product-mrp {
        font-size: 11px;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 12px;
        width: 100%;
        text-align: center;
    }
    
    /* Cart Page Mobile */
    .cart-container {
        padding: 20px 15px;
    }
    
    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
        width: 100%;
    }
    
    .cart-table thead {
        display: none;
    }
    
    .cart-table tr {
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 10px;
        padding: 10px;
        background: white;
    }
    
    .cart-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none;
        text-align: right;
        padding-left: 0;
    }
    
    .cart-table td:before {
        content: attr(data-label);
        font-weight: bold;
        width: 40%;
        text-align: left;
        position: static;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
        margin-right: 0;
    }
    
    .quantity-input {
        width: 50px;
        padding: 5px;
    }
    
    .cart-summary {
        max-width: 100%;
        margin-top: 20px;
    }
    
    /* Checkout Mobile */
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px 15px;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Product Detail Mobile */
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px 15px;
    }
    
    .product-detail-info h1 {
        font-size: 24px;
    }
    
    .product-detail-price {
        font-size: 28px;
    }
    
    .product-detail-mrp {
        font-size: 16px;
    }
    
    .quantity-selector {
        flex-wrap: wrap;
    }
    
    /* QR Payment Mobile */
    .qr-container {
        padding: 20px 15px;
        margin: 20px;
    }
    
    .qr-image {
        max-width: 200px;
    }
    
    .payment-details p {
        font-size: 13px;
        word-break: break-all;
    }
    
    .upload-area {
        padding: 20px;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 40px 20px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-section a {
        display: inline-block;
        margin: 5px 10px;
    }
    
    /* Admin Panel Mobile */
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 15px;
    }
    
    .sidebar a {
        display: inline-block;
        margin: 5px;
        padding: 8px 12px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .data-table {
        display: block;
        overflow-x: auto;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
}

/* ============================================
   TABLET STYLES (769px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    .category-grid,
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .container {
        padding: 0 20px;
    }
    
    .hero h1 {
        font-size: 42px;
    }
    
    .section-title {
        font-size: 32px;
    }
}

/* ============================================
   SMALL MOBILE (BELOW 480px)
   ============================================ */

@media (max-width: 480px) {
    .category-grid,
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .btn {
        padding: 10px;
    }
    
    .cart-summary p {
        font-size: 16px;
    }
    
    .total-amount {
        font-size: 20px;
    }
}

/* ============================================
   TOUCH-FRIENDLY STYLES
   ============================================ */

@media (max-width: 768px) {
    button,
    .btn,
    .add-to-cart,
    .category-card,
    .nav-links a,
    .sidebar a,
    .quantity-input,
    .cart-icon,
    .search-icon,
    .mobile-menu-toggle {
        cursor: pointer;
        touch-action: manipulation;
    }
    
    button,
    .btn,
    .add-to-cart {
        min-height: 44px;
    }
    
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.hide-on-mobile {
    display: block;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none;
    }
}

.show-on-mobile {
    display: none;
}

@media (max-width: 768px) {
    .show-on-mobile {
        display: block;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.product-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn-loading {
    opacity: 0.7;
    cursor: wait;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   PRODUCT CARD HOVER (Desktop Only)
   ============================================ */

@media (min-width: 769px) {
    .product-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 25px rgba(0,0,0,0.15);
    }
    
    .category-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
}