/* Reset and base styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f7f7f7; color: #222; }
header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 3vw; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.04); position: sticky; top: 0; z-index: 10; }
.logo { font-size: 2rem; font-weight: bold; color: #2a7ae2; letter-spacing: 2px; }
nav a { margin-left: 2rem; text-decoration: none; color: #222; font-weight: 500; transition: color 0.2s; }
nav a:hover { color: #2a7ae2; }

.hero { background: linear-gradient(120deg, #2a7ae2 0%, #6dd5ed 100%); color: #fff; text-align: center; padding: 5rem 2vw 4rem 2vw; }
.hero h1 { font-size: 3rem; margin-bottom: 1rem; animation: fadeInDown 1s; }
.hero p { font-size: 1.3rem; margin-bottom: 2rem; animation: fadeInUp 1.2s; }
.cta { background: #fff; color: #2a7ae2; padding: 0.8rem 2.2rem; border-radius: 30px; font-size: 1.1rem; font-weight: bold; text-decoration: none; box-shadow: 0 4px 20px rgba(42,122,226,0.15); transition: background 0.2s, color 0.2s; animation: fadeIn 1.5s; }
.cta:hover { background: #2a7ae2; color: #fff; }

.products-section { padding: 3rem 2vw; }
.products-section h2 { text-align: center; margin-bottom: 2rem; font-size: 2.2rem; color: #2a7ae2; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; }
.product-card { background: #fff; border-radius: 16px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); padding: 1.5rem; text-align: center; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; position: relative; overflow: hidden; }
.product-card:hover { transform: translateY(-8px) scale(1.03); box-shadow: 0 8px 32px rgba(42,122,226,0.13); }
.product-card img { width: 120px; height: 120px; object-fit: contain; margin-bottom: 1rem; transition: transform 0.3s; }
.product-card:hover img { transform: scale(1.1) rotate(-5deg); }
.product-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.product-price { color: #2a7ae2; font-size: 1.1rem; font-weight: bold; margin-bottom: 0.7rem; }
.product-desc { font-size: 0.95rem; color: #555; margin-bottom: 1rem; }
.add-btn { background: #2a7ae2; color: #fff; border: none; padding: 0.6rem 1.5rem; border-radius: 20px; font-size: 1rem; cursor: pointer; transition: background 0.2s; }
.add-btn:hover { background: #185a9d; }

.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 100; opacity: 1; pointer-events: all; transition: opacity 0.3s; }
.modal.hidden { opacity: 0; pointer-events: none; }
.modal-content { background: #fff; border-radius: 16px; padding: 2rem; min-width: 320px; max-width: 95vw; box-shadow: 0 8px 32px rgba(42,122,226,0.13); position: relative; animation: popIn 0.4s; }
.close-btn { position: absolute; top: 1rem; right: 1rem; font-size: 1.5rem; color: #888; cursor: pointer; }
.close-btn:hover { color: #2a7ae2; }
#modal-img { width: 180px; height: 180px; object-fit: contain; margin-bottom: 1rem; }
#add-to-cart-btn { margin-top: 1rem; }

#cart-items { list-style: none; margin: 1rem 0; padding: 0; }
#cart-items li { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.7rem; }
.remove-btn { background: #ff4d4f; color: #fff; border: none; border-radius: 12px; padding: 0.3rem 0.8rem; cursor: pointer; font-size: 0.9rem; }
.remove-btn:hover { background: #d9363e; }
.cart-total { font-weight: bold; text-align: right; margin-top: 1rem; }

footer { text-align: center; padding: 2rem 0 1rem 0; color: #888; font-size: 1rem; }

.hidden { display: none !important; }

#checkout-section { background: #fff; border-radius: 16px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); padding: 2rem; max-width: 500px; margin: 2rem auto; }
#checkout-section h2 { color: #2a7ae2; margin-bottom: 1.5rem; }
#checkout-cart { margin-bottom: 1.5rem; }
#checkout-form { display: flex; flex-direction: column; gap: 1rem; }
#checkout-form input { padding: 0.7rem; border-radius: 8px; border: 1px solid #ccc; font-size: 1rem; }
#checkout-form button { background: #2a7ae2; color: #fff; border: none; padding: 0.8rem; border-radius: 8px; font-size: 1.1rem; cursor: pointer; transition: background 0.2s; }
#checkout-form button:hover { background: #185a9d; }
#checkout-message { margin-top: 1rem; color: #2a7ae2; font-weight: bold; }

#login-modal .modal-content, #register-modal .modal-content { min-width: 320px; max-width: 95vw; }
#login-form, #register-form { display: flex; flex-direction: column; gap: 1rem; }
#login-form input, #register-form input { padding: 0.7rem; border-radius: 8px; border: 1px solid #ccc; font-size: 1rem; }
#login-form button, #register-form button { background: #2a7ae2; color: #fff; border: none; padding: 0.8rem; border-radius: 8px; font-size: 1.1rem; cursor: pointer; transition: background 0.2s; }
#login-form button:hover, #register-form button:hover { background: #185a9d; }
#login-message, #register-message { margin-top: 1rem; color: #2a7ae2; font-weight: bold; min-height: 1.2em; }

#orders-modal .modal-content { min-width: 320px; max-width: 95vw; }
#orders-list { margin-top: 1rem; }
#orders-list ul { list-style: none; padding: 0; }
#orders-list li { margin-bottom: 1.2rem; border-bottom: 1px solid #eee; padding-bottom: 0.7rem; }
#orders-list .order-date { color: #888; font-size: 0.95rem; }
#orders-list .order-total { font-weight: bold; color: #2a7ae2; }

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .products-section { padding: 1.5rem 1vw; }
  .modal-content { padding: 1rem; min-width: 90vw; }
}

/* Animations */
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } } 