:root {
  --input-border-radius: 18px;
  --input-qty-border: 2px solid var(--color-primary);
  --input-control-size: 38px;
  --color-primary: #109caf;
  --color-secondary: #0198ab;
  --color-warning: #ffa07a;
  --color-separator: #aaa;
  --background-color: hsl(216, 33%, 97%);
  --card-background-color:  hsl(216, 33%, 99%);
  --text-primary: #222;
  --menu-active-opacity: 1.0;
  --menu-inactive-opacity: 0.5;
  --gradient-primary: linear-gradient(135deg, #109caf 0%, #009fc9 100%);
  --gradient-secondary: linear-gradient(135deg, #0198ab 0%, #009cc0 100%);
  --card-gradient: linear-gradient(135deg, hsl(187, 40%, 94%) 0%, hsl(187, 0%, 97%)100%);
  --input-border: 2px solid var(--color-primary);
  --input-control-size: 38px;
  --input-font-size: 16px;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:focus, a:active {
  outline: none;
}

/**/
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  margin-bottom: 50px;
}

.products > header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 22px 16px 14px 16px;
}

.products > header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

main {
  display: flex;
  justify-content: center;
}

.products {
  display: flex;
  width: fit-content;
  flex-direction: column;
  min-width: 300px;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--background-color);
  padding-top: 6px;
  padding-bottom: 6px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  justify-items: center;
  position: relative;
  z-index: 1;
}
.product-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.product-card .product-image {
  background: var(--card-gradient);
  display: grid;
  max-height: 290px;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.product-card .product-image.full {
  max-height: 600px;
  max-width: 500px;
}

.product-card .product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-card .product-info {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  padding: 10px 0px 12px 0px;
  width: 90%;
  max-width: 450px;
}

.product-price {
  color: var(--color-primary);
  font-weight: 800;
}

.product-description {
  color: #333;
}

.product-cart-btn,
.product-btn {
  margin-top: 6px;
  height: 38px;
  border-radius: 12px;
  border: 0;
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  font-size: 90%;
}

.product-cart-btn:active,
.product-btn:active {
  transform: translateY(1px);
}

/* Single card sections reserved for future alignment adjustments */

.location {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 1rem;
}

.location-name {
  display: inline-flex;
  align-items: center;
}

.location-name::after {
    display: inline-block;
    content: url('/images/shevron.svg');
    margin-left: 4px;
    height: 16px;
    width: 16px;
    opacity: 0.6;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--background-color);
  border-style: solid;
  border-color: var(--background-color);
  border-width: 2px;
  border-radius: 8px;
  min-height: 40px;
  margin: 16px;
  padding-left: 10px;
  padding-right: 10px;
  transition: border-color 0.1s ease-in-out;
}
.search-input {
  font-size: 1.1rem;
  flex: 1;
  padding: 4px;
  border-style: none;
  background-color: #ffffff00;
}
.search-input:focus {
  border-style: none;
  outline-style: none;
}
.search-bar:has(.search-input:focus) {
    border-color: var(--color-primary);
}

.mobile-menu {
  display: flex;
  justify-content: space-around;
  background-color: #fff;
  width: 100%;
  height: 50px;
  position: fixed;
  bottom: 0;
  margin-top: auto;
  z-index:1000;
}

.menu-item {
  color: var(--text-primary);
  line-height: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 0.8rem;
  color: hsl(0, 0%, 40%);
  position: relative;
}


/* --- Cart Page Styles --- */
.cart-page {
  padding: 0 12px 80px 12px;
}

#cartItems {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 10px;
  padding: 12px 8px;
  background: #fff;
  width: 90%;
  max-width: 500px;
  min-width: 320px;
  border-bottom: var(--color-separator);
}

.cart-item-image {
  display: grid;
  place-items: center;
  max-width: 110px;
  max-height: 250px;
  aspect-ratio: 3 / 4;
  margin: auto;
  background: var(--card-gradient);
}

.cart-item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cart-item-price {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.cart-item-title {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.cart-item-company, .cart-item-variant {
  font-size: 0.9rem;
  color: #6b7280;
}

.cart-item-quantity-controls {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.cart-item-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

.remove-btn, .favorite-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.favorite-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.remove-btn:active, .favorite-btn:active {
  transform: scale(0.95);
}

.qty-minus-btn {
    width: var(--input-control-size);
    height: var(--input-control-size);
    margin: 0;
    background: #fff;
    border: var(--input-qty-border);
    border-right: none;
    border-radius: var(--input-control-size) 0px 0px var(--input-control-size);
    color: var(--color-primary);
    cursor: pointer;
    font-size: var(--input-font-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.qty-input {
    margin: 2px 0px;
    height: var(--input-control-size);
    width: 38px;
    border-top: var(--input-border);
    border-bottom: var(--input-border);
    border-left: none;
    border-right: none;
    border-radius: 0px;
    padding: 0px 0px;
    text-align: center;
    font-size: var(--input-font-size);
    color: #2c3e50;
    background: #fff;
    transition: border-color 0.2s;
}

.qty-plus-btn {
    width: var(--input-control-size);
    height: var(--input-control-size);
    margin: 0;
    background: #fff;
    border: var(--input-qty-border);
    border-left: none;
    border-radius: 0px var(--input-control-size) var(--input-control-size) 0px;
    color: var(--color-primary);
    cursor: pointer;
    font-size: var(--input-font-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.cart-summary {
  padding: 0 16px 16px 16px;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.cart-summary-row .label { color: #6b7280; }
.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 2rem;
  font-weight: 800;
  margin: 10px 0 16px 0;
}
.checkout-btn {
  font-size: 125%;
}

/* Modern Checkout Overlay Styles */
.checkout-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.checkout-overlay.active {
    opacity: 1;
    visibility: visible;
}

.checkout-modal {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkout-overlay.active .checkout-modal {
    transform: scale(1) translateY(0);
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 20px 28px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.checkout-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    z-index: -1;
}

.checkout-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: white;
}

.close-checkout {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-checkout:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.checkout-content {
    padding: 32px 28px;
}

.checkout-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 24px 0;
    text-align: center;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.contact-btn:hover::before {
    left: 100%;
}

.contact-btn.whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.contact-btn.whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.contact-btn.telegram {
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.contact-btn.telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.contact-btn.phone {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.contact-btn.phone:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.checkout-note {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .checkout-overlay {
        padding: 16px;
    }

    .checkout-modal {
        border-radius: 20px;
    }

    .checkout-header {
        padding: 20px 24px 16px 24px;
    }

    .checkout-header h3 {
        font-size: 1.25rem;
    }

    .checkout-content {
        padding: 24px 20px;
    }

    .contact-btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}


/* --- Footer (derived from original) --- */
.footer {
  background: #fff;
  border-top: 1px solid #e5e7eb;
  margin-top: 40px;
  padding: 0 0 24px 0;
}
.footer .container {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 24px 16px 12px 16px;
}
.footer-contact a {
  display: block;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 20px;
  margin-right: 12px;
  padding: 8px;
}
.footer-messengers {
  display: flex;
  gap: 16px;
}
.footer-messengers .messenger-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3f4f6;
  color: var(--color-primary);
}
.footer-bottom {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin-top: 6px;
  padding: 0 16px;
}
.footer-disclaimer {
  color: #a0aec0;
  font-size: 13px;
  margin-top: 4px;
}

/* Cart badge */
.cart-count {
  position: absolute;
  left: calc(50% + 7px);
  top: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: rgba(241, 17, 126, 1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 18px;
  z-index: 1001;
  opacity: 1;
}

/* Favorite badge */
.favorite-count {
  position: absolute;
  left: calc(50% + 7px);
  top: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: rgba(241, 17, 126, 1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 18px;
  z-index: 1001;
  opacity: 1;
}

/* --- City Overlay Styles --- */
.city-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: flex-start; /* keep overlay anchored to top */
  justify-content: center;
  padding-top: calc(10px + env(safe-area-inset-top));
  z-index: 2000;
}
.city-overlay.active { display: flex; }

.city-modal {
  width: min(560px, 92vw);
  max-height: 80vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}
.city-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.close-city {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  width: 32px;
  height: 32px;
}
.city-content { padding: 10px 16px 16px 16px; }
.city-search-input {
  width: 100%;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 12px;
  margin-bottom: 10px;
}
.city-list {
  max-height: 52vh;
  overflow: auto;
}
.city-item {
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.city-item:hover {
  background: #f3f4f6;
}


@media (min-width: 768px) {
  body {
    font-size: 1.125rem;
    max-width: 70%;
    margin: auto;
    margin-bottom: 50px;
  }
  .mobile-menu {
    max-width: 70%;
  }
}


@media (min-width: 1024px) {
  body {
    font-size: 1.25rem;
    max-width: 800px;
  }
  .mobile-menu {
    max-width: 800px;
  }
}

/* --- Search Overlay Styles --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999;
    display: none;
    flex-direction: column;
    padding: 16px;
}

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

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.search-overlay-input {
    flex-grow: 1;
    height: 44px;
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 0 15px;
    font-size: 1.1rem;
}

.search-overlay-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    background: var(--card-background-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #eef;
}

.search-result-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 10px;
    border-radius: 4px;
    background: #fff;
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-title {
    font-weight: 600;
}

.search-result-price {
    color: var(--color-primary);
    font-size: 0.9rem;
}

/* --- Delivery Page Styles --- */
.delivery-page {
    padding: 20px 16px;
}

.delivery-page .page-title {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

.delivery-info h2 {
    font-size: 1.5rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--color-primary);
}

.delivery-info p, .delivery-info li {
    line-height: 1.6;
    margin-bottom: 10px;
}

.delivery-info ol {
    margin-left: 20px;
    padding-left: 0;
}

.delivery-info strong {
    font-weight: 700;
}

/* --- Favorite Button Styles --- */
.favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.favorite-btn:hover {
  color: #dc2626;
  transform: scale(1.1);
}

.favorite-btn.active {
  color: #dc2626;
  transform: scale(1.1);
}

.favorite-btn.active:hover {
  color: #b91c1c;
  transform: scale(1.15);
}

.favorite-btn:active {
  transform: scale(0.95);
}

/* Responsive adjustments for favorite button */
@media (max-width: 480px) {
  .favorite-btn {
    width: 32px;
    height: 32px;
    top: 6px;
    right: 6px;
  }
}

@media (min-width: 768px) {
  .favorite-btn {
    width: 40px;
    height: 40px;
    top: 10px;
    right: 10px;
  }
}

/* --- Empty Favorites Styles --- */
.empty-favorites {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 40px 20px;
}

.empty-favorites-content {
  text-align: center;
  color: #6b7280;
}

.empty-favorites-content svg {
  color: #d1d5db;
  margin-bottom: 20px;
}

.empty-favorites-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #374151;
}

.empty-favorites-content p {
  font-size: 1rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.browse-products-btn {
  display: inline-block;
  padding: 12px 24px;
  background: var(--gradient-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.browse-products-btn:hover {
  transform: translateY(-2px);
}

.browse-products-btn:active {
  transform: translateY(0);
}

