/* style.css */

@font-face {
  font-family: "MyBanglaFont";
  src: url("./fonts/kalpurush.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "MyBanglaFont", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f7fa;
  padding-top: 80px; /* Add top padding to body to compensate for fixed header */
}

.container {
  max-width: 100%;
  margin: 0 auto;
}

/* ===== RESPONSIVE HEADER STYLES ===== */

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 100px 10px 30px;
  background: #fff;
  /* Added to ensure the header spans the full width on all devices */
  width: 100%;
  box-sizing: border-box;
  /* Added fixed positioning and scroll behavior */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header hidden state when scrolling down */
.header.hidden {
  transform: translateY(-100%);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 50px;
}

.site-logo img {
  height: 60px;
  width: auto;
  display: block;
}

/* Added beautiful styling for category_id dropdown */
#category_id {
  display: block;
  width: 300px;
  margin: 10px 20px 10px 80px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  outline: none;
  position: relative;
}

#category_id:hover {
  border-color: #27ae60;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

#category_id:focus {
  border-color: #2ecc71;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

#category_id option {
  background: #333;
  color: #fff;
  padding: 10px;
  border: none;
}

#category_id option:hover {
  background: #27ae60;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.cart-icon,
.wishlist-icon {
  position: relative;
  font-size: 26px;
  background-color: #004626;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  line-height: 45px;
  text-align: center;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cart-count,
.wishlist-count {
  position: absolute;
  top: 2px;
  right: 5px;
  color: white;
  background: #e74c3c;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: bold;
}

.icon-btn {
  background-color: #004626;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-btn {
  font-size: 25px;
  margin-right: 10px;
  cursor: pointer;
  background-color: #004626;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 50px;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: #27ae60;
  transform: scale(1.05);
}

.btn:active {
  transform: scale(0.95);
}

/* ===== SEARCH STYLES ===== */
.search-wrapper {
  display: none;
  align-items: center;
  width: 80%;
  max-width: 760px;
  position: relative;
}

.header.search-open .search-wrapper {
  display: flex;
}

#searchInput {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #dcdde1;
  font-size: 15px;
  outline: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

#searchClose {
  margin-left: 8px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #7f8c8d;
}

/* ===== FILTER BUTTONS ===== */
.filter-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

/* ===== PRODUCT GRID ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}

.product-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.product-image {
  height: 220px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .product-image img {
  transform: scale(1.06);
}

.discount-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  background: #ccffcb49;
  color: #fff;
  z-index: 2;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1100;
}

.product-card:hover .image-overlay {
  opacity: 1;
}

.action-buttons {
  display: flex;
  gap: 12px;
}

.action-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  color: #333;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  transform: translateY(20px);
  opacity: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.product-card:hover .action-btn {
  transform: translateY(0);
  opacity: 1;
}

.action-btn:hover {
  background: #3498db;
  color: #fff;
}

/* ===== PRODUCT INFO ===== */
.product-info {
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.remark-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
}

.remark-popular {
  background: #e74c3c;
}
.remark-new {
  background: #2ecc71;
}
.remark-top {
  background: #f39c12;
}
.remark-special {
  background: #9b59b6;
}
.remark-trending {
  background: #e84393;
}
.remark-regular {
  background: #7f8c8d;
}

.stock-info {
  display: flex;
  align-items: center;
  background: #f4f6f8;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 13px;
}

.stock-status {
  display: flex;
  align-items: center;
}

.stock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.in-stock-dot {
  background: #2ecc71;
}
.out-of-stock-dot {
  background: #e74c3c;
}
.in-stock-text {
  color: #2ecc71;
  font-weight: 600;
}
.out-of-stock-text {
  color: #e74c3c;
  font-weight: 600;
}

.title-desc {
  font-size: 15px;
  color: #2c3e50;
  font-weight: 500;
  margin: 6px 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-desc .product-title,
.title-desc .product-desc {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-desc .separator {
  color: #7f8c8d;
  margin: 0 4px;
}

.product-price {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.current-price {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
}

.original-price {
  font-size: 15px;
  color: #95a5a6;
  text-decoration: line-through;
  margin-left: 10px;
}

.discount-price {
  font-size: 15px;
  color: #e74c3c;
  font-weight: 600;
  margin-left: 10px;
}

.add-to-cart,
.buy-now {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: auto;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.add-to-cart:hover {
  background: linear-gradient(135deg, #2980b9, #2573a6);
}

.buy-now {
  margin-top: 10px;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.buy-now:hover {
  background: gray;
}

/* ===== LOADING & ERROR STATES ===== */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  color: #7f8c8d;
}

.error {
  text-align: center;
  padding: 40px;
  color: #e74c3c;
  font-size: 18px;
}

/* ===== MODAL STYLES ===== */
.cart-modal,
.wishlist-modal,
.product-detail-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
}

.cart-content,
.wishlist-content {
  background: white;
  margin: 50px auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 1000px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #7f8c8d;
  transition: color 0.3s;
}

.close-modal:hover {
  color: #e74c3c;
}

.cart-title,
.wishlist-title {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

/* ===== CART MODAL ===== */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  gap: 15px;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.cart-item-price {
  color: #e74c3c;
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ddd;
  border: none;
  cursor: pointer;
}

.qty-input {
  width: 40px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
}

.remove-cart {
  background: #e74c3c;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: none;
}

.cart-total {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
  text-align: right;
  font-size: 18px;
  font-weight: 600;
}

.empty-cart,
.empty-wishlist {
  text-align: center;
  padding: 40px;
  color: #7f8c8d;
}

.checkout-btn {
  margin-top: 20px;
  padding: 12px 24px;
  background: #2ecc71;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.checkout-btn:hover {
  background: #27ae60;
}

/* ===== WISHLIST MODAL ===== */
.wishlist-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.wishlist-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  position: relative;
}

.remove-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e74c3c;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: none;
}

.wishlist-item-img {
  height: 120px;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* ===== PRODUCT DETAIL MODAL ===== */
.product-detail-modal {
  z-index: 1100;
  padding: 20px;
}

.product-detail-content {
  background: white;
  margin: 20px auto;
  padding: 30px;
  border-radius: 12px;
  width: 95%;
  max-width: 1200px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.product-detail-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #7f8c8d;
  z-index: 10;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-detail-close:hover {
  color: #e74c3c;
}

.product-detail-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.product-detail-gallery {
  position: relative;
}

.product-detail-main-image {
  width: 100%;
  height: 400px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8f9fa;
  margin-bottom: 15px;
}

.product-detail-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px;
}

.product-detail-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.3s;
  border: 2px solid transparent;
}

.product-detail-thumbnail:hover,
.product-detail-thumbnail.active {
  opacity: 1;
  border-color: #3498db;
}

.product-detail-info {
  padding: 10px;
}

.product-detail-title {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 15px;
}

.product-detail-price {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  font-size: 22px;
}

.product-detail-description {
  color: #34495e;
  line-height: 1.6;
  margin-bottom: 25px;
  font-size: 16px;
}

.product-detail-stock {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.product-detail-stock.in-stock {
  background: #e8f8f2;
  color: #27ae60;
}

.product-detail-stock.out-of-stock {
  background: #fbeeee;
  color: #e74c3c;
}

.product-detail-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.product-detail-btn {
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-detail-btn.primary {
  background: #3498db;
  color: white;
  flex: 2;
}

.product-detail-btn.primary:hover {
  background: #2980b9;
}

.product-detail-btn.secondary {
  background: #f8f9fa;
  color: #2c3e50;
  flex: 1;
}

.product-detail-btn.secondary:hover {
  background: #e9ecef;
}

.product-detail-meta {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.product-detail-meta-item {
  display: flex;
  margin-bottom: 10px;
}

.product-detail-meta-label {
  font-weight: 600;
  color: #2c3e50;
  min-width: 120px;
}

.product-detail-meta-value {
  color: #7f8c8d;
}

/* ===== NOTIFICATIONS ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  z-index: 1001;
  display: none;
}

.notification.success {
  background: #2ecc71;
}

.notification.error {
  background: #e74c3c;
}

.login-prompt {
  text-align: center;
  padding: 20px;
  margin: 20px 0;
  background: #fff3cd;
  border-radius: 8px;
  color: #856404;
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablet Screens (768px and below) */
@media (max-width: 768px) {
  .header {
    /* Use flexbox to control layout */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
  }

  .header-left,
  .header-actions {
    /* Adjust spacing and alignment */
    gap: 10px;
  }

  .header-left {
    /* Control the order of items in the left section */
    order: 1;
  }

  .header-actions {
    /* Control the order of items in the actions section */
    order: 2;
  }

  .site-logo {
    /* Set the order for the logo */
    order: -1;
  }

  .sidebar-btn {
    /* Set the order for the sidebar button */
    order: 0;
  }

  .header-center {
    /* Hide the search input on tablet and mobile view by default */
    display: none;
  }

  .header-actions {
    /* Ensure the icons are on the same line and spaced out */
    display: flex;
    align-items: center;
    gap: 15px;
  }

  /* Mobile specific icon order */
  .header-actions #wishlistIcon {
    order: 1;
  }
  .header-actions #cartIcon {
    order: 2;
  }

  /* Ensure the search wrapper is visible when activated */
  .header.search-open .header-center {
    display: flex;
    flex-basis: 100%;
    order: 3;
    margin-top: 10px;
  }

  .search-wrapper {
    width: 100%;
  }

  #category_id {
    display: none;
  }

  .header-actions #searchIcon {
    display: none;
  }
}

/* Mobile Screens (576px and below) */
@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .filter-buttons {
    overflow-x: auto;
    padding-bottom: 10px;
    justify-content: flex-start;
  }

  .cart-content {
    padding: 20px 15px;
    width: 95%;
  }

  .product-detail-main-image {
    height: 250px;
  }

  .product-header {
    display: none;
  }

  .header {
    padding: 10px;
  }

  #category_id {
    display: none;
  }

  .header-actions #searchIcon {
    display: none;
  }
}
