/* Mobile-First CSS for Dragenbit Mobile Shop */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Header */
.mobile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    position: relative;
    transition: all 0.3s ease;
}

.cart-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.menu-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.menu-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Navigation */
.mobile-nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 70px;
    left: -100%;
    width: 280px;
    height: calc(100vh - 70px);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-nav.active {
    left: 0;
}

.nav-list {
    list-style: none;
    padding: 1rem 0;
}

.nav-list li {
    border-bottom: 1px solid #eee;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

/* Main Content */
.mobile-main {
    min-height: calc(100vh - 140px);
    padding-bottom: 4rem;
}

.view-section {
    display: none;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: block;
}

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

/* Products View */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#mobileSearch {
    flex: 1;
    border: none;
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 8px;
}

#searchBtn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#searchBtn:hover {
    background: #5a67d8;
}

.filter-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-controls select {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f8f9fa;
}

.product-info {
    padding: 1rem;
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.product-price {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-stock {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.product-stock.low-stock {
    color: #e74c3c;
    font-weight: 600;
}

.product-stock.out-of-stock {
    color: #95a5a6;
    font-weight: 600;
}

.add-to-cart-btn {
    width: 100%;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.add-to-cart-btn:hover {
    background: #5a67d8;
    transform: scale(1.02);
}

.add-to-cart-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Cart View */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cart-header h2 {
    font-size: 1.5rem;
    color: #333;
}

.clear-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #c0392b;
}

.cart-items {
    margin-bottom: 1.5rem;
}

.cart-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

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

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.cart-item-price {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #e9ecef;
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
}

.cart-summary {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.summary-row.total {
    font-weight: 700;
    font-size: 1.2rem;
    color: #667eea;
    padding-top: 0.75rem;
    border-top: 2px solid #667eea;
}

.checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Checkout View */
.checkout-container {
    max-width: 500px;
    margin: 0 auto;
}

.checkout-form {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.delivery-options,
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.delivery-option,
.payment-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delivery-option:hover,
.payment-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.delivery-option input,
.payment-option input {
    margin-right: 0.75rem;
}

.order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.place-order-btn {
    width: 100%;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.place-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(39, 174, 96, 0.4);
}

.place-order-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Account View */
.account-container {
    max-width: 500px;
    margin: 0 auto;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

.info-card h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.order-history {
    max-height: 400px;
    overflow-y: auto;
}

.order-history-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-history-item:hover {
    background: #f8f9ff;
}

/* Footer */
.mobile-footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
}

/* Utility Classes */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #667eea;
}

.loading-indicator.active {
    display: block;
}

.loading-indicator i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.no-products-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-products-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #95a5a6;
}

.no-products-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.no-products-message p {
    font-size: 1rem;
    color: #666;
}

.connection-error {
    text-align: center;
    padding: 3rem 1rem;
    color: #e74c3c;
}

.connection-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e74c3c;
}

.connection-error h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #c0392b;
}

.connection-error p {
    font-size: 1rem;
    color: #e74c3c;
}

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: calc(100vw - 40px);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #27ae60;
}

.notification.error {
    background: #e74c3c;
}

.notification.warning {
    background: #f39c12;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.loading-content i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
    
    .cart-header h2 {
        font-size: 1.2rem;
    }
    
    .checkout-container {
        padding: 0 0.5rem;
    }
    
    .checkout-form {
        padding: 1rem;
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .mobile-nav {
        width: 320px;
    }
}
