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

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

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50;
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    max-width: 400px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
    border-radius: 0;
    overflow: hidden;
}

/* Header Banner */
.header-banner {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 50%, #1a1a1a 100%);
    padding: 25px 20px;
    border-radius: 0;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="coffee-pattern" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="%23ffffff" fill-opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23coffee-pattern)"/></svg>');
    opacity: 0.3;
}

.banner-content {
    position: relative;
    z-index: 2;
}

.brand-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.brand-logo {
    height: 80px;
    width: auto;
    max-width: 280px;
    filter: invert(1) brightness(1.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.brand-logo:hover {
    transform: scale(1.05);
    filter: invert(1) brightness(1.4) drop-shadow(0 0 10px rgba(255,255,255,0.5));
}

.banner-text {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

.discount-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.4);
    color: white;
    position: relative;
    z-index: 2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Navigation */
.nav-tabs {
    display: flex;
    padding: 20px;
    gap: 12px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-tab {
    flex: 1;
    padding: 12px 16px;
    border-radius: 20px;
    text-align: center;
    background: #f8f9fa;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.nav-tab:hover::before {
    left: 100%;
}

.nav-tab.active {
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    color: white;
    border-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 26, 26, 0.3);
}

.nav-tab:hover {
    background: linear-gradient(135deg, #333, #555);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(51, 51, 51, 0.2);
}

/* Products Grid */
.products-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    animation: fadeIn 0.6s ease-out;
}

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

.product-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    text-align: right;
    gap: 15px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border-color: rgba(26, 26, 26, 0.1);
}

.product-card:hover::before {
    opacity: 1;
}

.product-image {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.product-card:hover .product-image {
    transform: scale(1.1) rotate(5deg);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-family: 'Tajawal', sans-serif;
    position: relative;
    z-index: 2;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.current-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    font-family: 'Tajawal', sans-serif;
}

.original-price {
    font-size: 13px;
    color: #95a5a6;
    text-decoration: line-through;
    font-weight: 400;
}

.add-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(26, 26, 26, 0.1);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.add-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    opacity: 0;
    transition: opacity 0.3s;
}

.add-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(26, 26, 26, 0.2);
    color: white;
}

.add-btn:hover::before {
    opacity: 1;
}

.add-btn span {
    position: relative;
    z-index: 2;
}

/* Cart Button */
.cart-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: 360px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    color: white;
    border: none;
    padding: 18px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 30px rgba(26, 26, 26, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.cart-button:hover {
    background: linear-gradient(135deg, #000, #1a1a1a);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-count {
    background: white;
    color: #333;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.cart-total {
    font-size: 18px;
}

/* Cart Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 20px;
    max-width: 380px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.modal-header h2 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 20px;
}

.close {
    color: #95a5a6;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close:hover {
    color: #1a1a1a;
    background: #f8f9fa;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f8f9fa;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #2c3e50;
    font-family: 'Tajawal', sans-serif;
}

.cart-item-price {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #1a1a1a;
    color: white;
    border-color: #1a1a1a;
    transform: scale(1.1);
}

.quantity {
    font-weight: 700;
    min-width: 25px;
    text-align: center;
    color: #1a1a1a;
    font-size: 16px;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.4s;
}

.checkout-btn:hover {
    background: linear-gradient(135deg, #000, #1a1a1a);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.empty-cart {
    text-align: center;
    color: #95a5a6;
    padding: 60px 20px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
}

/* Loading Animation */
@keyframes productLoad {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        box-shadow: none;
    }
    
    .header-banner {
        padding: 25px 15px;
    }
    
    .brand-logo {
        height: 60px;
        max-width: 200px;
    }
    
    .nav-tabs {
        padding: 15px;
        gap: 8px;
    }
    
    .nav-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-banner {
        padding: 20px 15px;
    }
    
    .brand-logo {
        height: 50px;
        max-width: 160px;
    }
    
    .banner-text {
        font-size: 15px;
        margin-bottom: 15px;
    }
    
    .cart-button {
        bottom: 15px;
        right: 15px;
        left: 15px;
        padding: 16px 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
}

@media (max-width: 320px) {
    .header-banner {
        padding: 18px 10px;
    }
    
    .brand-logo {
        height: 45px;
        max-width: 140px;
    }
    
    .banner-text {
        font-size: 14px;
    }
    
    .nav-tabs {
        padding: 12px;
        gap: 6px;
    }
    
    .nav-tab {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .products-grid {
        padding: 12px;
        gap: 12px;
    }
}