@tailwind base;
@tailwind components;
@tailwind utilities;

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  scroll-behavior: smooth;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Navbar link underline effect */
.nav-link {
  position: relative;
  transition: all 0.3s;
}

.nav-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #dc2626;
  transition: width 0.3s;
}

.nav-link:hover:after,
.nav-link.active:after {
  width: 100%;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

/* Product Card */
.product-card {
  background: white;
  border-radius: 1.5rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -12px rgba(0, 0, 0, 0.15);
}

/* Product Image Container - Perfect Frame for Any Image Size */
.product-image-container {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: #f3f4f6;
  border-radius: 1rem 1rem 0 0;
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

/* Product Info */
.product-info {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8rem;
  color: #1f2937;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: #dc2626;
  margin: 0.75rem 0;
}

.product-price small {
  font-size: 0.875rem;
  font-weight: normal;
  color: #6b7280;
}

/* Add to Cart Button */
.add-to-cart-btn {
  width: 100%;
  background-color: #000000;
  color: white;
  padding: 0.75rem;
  border-radius: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-top: auto;
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
}

.add-to-cart-btn:hover {
  background-color: #dc2626;
  transform: scale(0.98);
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -450px;
  width: 100%;
  max-width: 450px;
  height: 100%;
  background: white;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.2);
  transition: right 0.5s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.cart-sidebar.open {
  right: 0;
}

/* Modal */
#productModal {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* News Slider */
.news-slider-container {
  overflow-x: clip;
  position: relative;
  width: 100%;
}

.news-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  gap: 1.5rem;
}

.news-card {
  flex: 0 0 calc(100% / 1.2);
  transition: transform 0.3s, opacity 0.3s;
}

@media (min-width: 768px) {
  .news-card {
    flex: 0 0 calc(33.333% - 1rem);
  }
}

@media (min-width: 1024px) {
  .news-card {
    flex: 0 0 calc(25% - 1.2rem);
  }
}

.slider-btn {
  transition: all 0.2s ease;
}

.slider-btn:hover:not(:disabled) {
  background-color: #dc2626;
  color: white;
  border-color: #dc2626;
}

.slider-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Filter Container */
.filter-container {
  background: white;
  padding: 1.5rem;
  border-radius: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* No Products */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 1.5rem;
  color: #6b7280;
}

.no-products i {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #d1d5db;
}

/* Notification Toast */
.notification-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: black;
  color: white;
  padding: 12px 24px;
  border-radius: 9999px;
  z-index: 10001;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease;
  white-space: nowrap;
  font-size: 14px;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #dc2626;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #991b1b;
}

/* Newsletter Input */
#newsletterEmail:focus {
  outline: none;
  box-shadow: 0 0 0 2px #dc2626;
}

/* WhatsApp Button - Left of Scroll to Top */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 85px;
  background-color: #25D366;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.3s ease;
  text-decoration: none;
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  background-color: #128C7E;
  color: white;
}

/* Scroll to Top Button - Rightmost Position */
#scrollToTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #dc2626;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  border: none;
}

#scrollToTopBtn.show {
  opacity: 1;
  visibility: visible;
}

#scrollToTopBtn:hover {
  transform: translateY(-5px);
  background-color: #ef4444;
}

/* WhatsApp Tooltip */
.whatsapp-tooltip {
  position: absolute;
  right: 60px;
  background: #1f2937;
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.whatsapp-float:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-3px);
}

/* Pulse Animation */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
  70% { box-shadow: 0 0 0 12px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Product Share Button on Cards */
.product-share-btn {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
}

.product-share-btn:hover {
  background: #10b981;
  transform: scale(1.1);
}

.product-share-btn:hover i {
  color: white;
}

/* Clickable Phone and Email Styles */
a[href^="tel:"], a[href^="mailto:"] {
  transition: all 0.3s ease;
}

a[href^="tel:"]:hover, a[href^="mailto:"]:hover {
  opacity: 0.8;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .whatsapp-float {
    width: 45px;
    height: 45px;
    font-size: 24px;
    bottom: 15px;
    right: 70px;
  }
  
  #scrollToTopBtn {
    width: 45px;
    height: 45px;
    bottom: 15px;
    right: 15px;
    font-size: 18px;
  }
  
  .whatsapp-tooltip {
    display: none;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  
  .product-info {
    padding: 0.875rem;
  }
  
  .product-title {
    font-size: 0.875rem;
    min-height: 2.4rem;
  }
  
  .product-price {
    font-size: 1.25rem;
  }
  
  .add-to-cart-btn {
    padding: 0.625rem;
    font-size: 0.75rem;
  }
  
  .filter-container {
    padding: 1rem;
  }
}

/* Tablet View */
@media (min-width: 481px) and (max-width: 768px) {
  .whatsapp-float {
    bottom: 20px;
    right: 80px;
  }
  
  #scrollToTopBtn {
    bottom: 20px;
    right: 20px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

/* Footer Styles */
footer a {
  transition: all 0.3s ease;
}

footer .fab, footer .fas {
  transition: transform 0.3s ease;
}

footer .fab:hover, footer .fas:hover {
  transform: scale(1.1);
}

/* Policy Modal Styles */
#privacyModal, #termsModal, #returnModal {
  animation: fadeIn 0.3s ease;
}