/* ====================================
   Meera Kirana - Modern Grocery Store
   Complete CSS with Animations
   ==================================== */

:root {
  --primary: #4CAF50;
  --primary-dark: #2E7D32;
  --primary-light: #81C784;
  --white: #FFFFFF;
  --bg: #F7F9FC;
  --text: #1A1A1A;
  --text-muted: #6B7280;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============ HEADER ============ */
.header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 100;
  transition: transform 0.3s ease;
  /* Smooth toggle */
}

.header.header-hidden {
  transform: translateY(-100%) !important;
}

.header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}

.logo i {
  font-size: 28px;
}

.search-bar {
  flex: 1;
  max-width: 600px;
  display: flex;
  align-items: center;
  background: var(--white);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-bar:focus-within {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.search-bar i {
  color: var(--text-muted);
  margin-right: 10px;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.icon-btn {
  position: relative;
  background: var(--white);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.icon-btn i {
  font-size: 20px;
  color: var(--primary);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #E8F5E9 0%, #F1F8F4 100%);
  animation: fadeIn 0.8s ease;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text {
  animation: slideInLeft 0.8s ease;
}

.hero-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  animation: bounceIn 0.6s ease 0.2s both;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.highlight {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(76, 175, 80, 0.4);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}


.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
}

.categories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.categories-scroll::-webkit-scrollbar {
  height: 6px;
}

.categories-scroll::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

.category-btn {
  flex-shrink: 0;
  padding: 12px 24px;
  background: white;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.category-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-btn.active {
  background: var(--primary);
  color: white;
}

/* ============ PRODUCTS GRID ============ */
.products-section {
  padding: 40px 0 80px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  animation: fadeInUp 0.4s ease;
}


.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #FF5252;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.product-category {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.product-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.product-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F5F5F5;
  padding: 8px 12px;
  border-radius: 8px;
}

.quantity-selector button {
  width: 28px;
  height: 28px;
  border: none;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 700;
}

.quantity-selector button:hover {
  background: var(--primary);
  color: white;
}

.quantity-selector span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.add-to-cart-btn {
  flex: 1;
  padding: 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.add-to-cart-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ============ CATEGORY PANEL ============ */
.category-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 450px;
  height: 100vh;
  background: white;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 200;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.category-panel.active {
  right: 0;
}

.panel-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 20px;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.panel-header h3 {
  font-size: 20px;
}

.close-panel {
  width: 36px;
  height: 36px;
  background: #F5F5F5;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.close-panel:hover {
  background: #E5E7EB;
}

.panel-content {
  padding: 20px;
  display: grid;
  gap: 16px;
}

/* ============ CART SIDEBAR ============ */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 420px;
  height: 100vh;
  background: white;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 201;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 {
  font-size: 20px;
}

.close-cart {
  width: 36px;
  height: 36px;
  background: #F5F5F5;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.close-cart:hover {
  background: #E5E7EB;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #F9FAFB;
  border-radius: 8px;
  margin-bottom: 12px;
}

.cart-item-image {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-price {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}

.cart-item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cart-item-actions button {
  width: 24px;
  height: 24px;
  border: none;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}

.cart-item-actions .remove-btn {
  background: #FEE2E2;
  color: #DC2626;
  margin-left: auto;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid #E5E7EB;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
}

.total-amount {
  color: var(--primary);
}

.empty-cart {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-cart i {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* ============ CHECKOUT PAGE ============ */
.checkout-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  z-index: 300;
  overflow-y: auto;
  display: none;
  animation: fadeIn 0.3s ease;
}

.checkout-page.active {
  display: block;
}

.checkout-page .container {
  padding: 40px 20px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 24px;
  font-weight: 600;
  transition: var(--transition);
}

.back-btn:hover {
  transform: translateX(-4px);
}

.checkout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  margin-top: 32px;
}

.checkout-section {
  background: white;
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.checkout-section h3 {
  font-size: 20px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.payment-option:hover {
  border-color: var(--primary);
}

.payment-option input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.order-summary {
  position: sticky;
  top: 20px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #E5E7EB;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
}

.total-row {
  font-size: 18px;
  font-weight: 700;
  border-top: 2px solid #E5E7EB;
  padding-top: 16px;
  margin-top: 8px;
}

/* ============ OVERLAY ============ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    /* Ensure no transform creates context */
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-slider {
    height: 300px;
  }

  .search-bar {
    max-width: none;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .product-image {
    height: 160px;
  }

  .category-panel,
  .cart-sidebar {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .header .container {
    flex-wrap: wrap;
    padding: 10px 15px;
    /* Reduced Padding */
    gap: 10px;
    /* Reduced Gap */
  }

  .search-bar {
    order: 3;
    width: 100%;
    padding: 8px 15px;
    /* Compacter Search */
    margin-top: 5px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer Base */
.footer {
  background: #1a6f3a;
  color: white;
  padding: 50px 20px 20px;
  font-family: 'Arial', sans-serif;
  position: relative;
  overflow: hidden;
}

.footer a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #a8e6a2;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1200px;
  margin: auto;
}

.footer h2,
.footer h3 {
  margin-bottom: 15px;
  animation: fadeInUp 1s ease forwards;
}

.footer p,
.footer ul {
  animation: fadeInUp 1.2s ease forwards;
}

.footer-about,
.footer-links,
.footer-support,
.footer-contact {
  flex: 1 1 220px;
  min-width: 220px;
}

.footer-links ul,
.footer-support ul {
  list-style: none;
  padding: 0;
}

.footer-links li,
.footer-support li {
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.footer-links li:hover,
.footer-support li:hover {
  transform: translateX(5px);
}

/* Newsletter */
.newsletter-form {
  display: flex;
  margin-top: 10px;
}

.newsletter-form input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 5px 0 0 5px;
  outline: none;
}

.newsletter-form button {
  background: #a8e6a2;
  border: none;
  padding: 10px 20px;
  color: #1a6f3a;
  font-weight: bold;
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  transition: background 0.3s ease;
}

.newsletter-form button:hover {
  background: #85c77b;
}

/* Social Icons */
.footer-social {
  margin-top: 15px;
}

.social-icon {
  display: inline-block;
  margin-right: 10px;
  background: #a8e6a2;
  color: #1a6f3a;
  width: 35px;
  height: 35px;
  line-height: 35px;
  text-align: center;
  flex-direction: column;
  gap: 30px;
}


/* BUTTON FLOATING STYLE */
.support-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #ffb703;
  color: #000;
  font-size: 20px;
  padding: 14px 22px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transition: 0.3s;
  animation: float 2s infinite ease-in-out;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }

  100% {
    transform: translateY(0);
  }
}

.support-btn:hover {
  transform: scale(1.07);
}

/* POPUP */
.support-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.support-content {
  background: white;
  padding: 30px;
  width: 330px;
  border-radius: 20px;
  text-align: center;
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.close-btn {
  float: right;
  cursor: pointer;
  font-size: 20px;
  user-select: none;
}

.qr-box img {
  width: 200px;
  margin: 10px auto;
  display: block;
  border-radius: 10px;
}

.amount-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 10px 0;
}

.amt-btn {
  background: #eee;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: 0.3s;
}

.amt-btn:hover {
  background: #ffd166;
}

.pay-now-btn {
  display: inline-block;
  margin-top: 12px;
  background: #06d6a0;
  padding: 10px 20px;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  font-weight: bold;
  transition: 0.3s;
}

.pay-now-btn:hover {
  background: #04b489;
}

/* Registration Ticker */
.ticker-wrap {
  width: 100%;
  background-color: #ff9800;
  /* Orange background for visibility */
  color: white;
  overflow: hidden;
  height: 40px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1002;
  /* Above header */
}

.ticker {
  display: inline-block;
  white-space: nowrap;
  animation: ticker 25s linear infinite;
  padding-left: 100%;
  /* Start off-screen */
}

.ticker-item {
  display: inline-block;
  padding: 0 2rem;
  font-size: 1rem;
  font-weight: 600;
}

@keyframes ticker {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

/* Mobile Ticker Adjustment */
@media (max-width: 480px) {
  .ticker-wrap {
    height: 35px;
  }

  .ticker-item {
    font-size: 0.85rem;
    padding: 0 1rem;
  }

}

@media (max-width: 768px) {

  .header-link-refer,
  .header-link-support {
    display: none !important;
  }
}