@import url("gridLayout.css");

/* OVERRIDE Main Grid Placement */
main {
  grid-column: 1 / 9;
  grid-row: 1 / auto;
  display: flex;
  flex-direction: column;
  padding: 40px 40px 24px;
  background-color: #fffbf7;
  font-family: "Cairo", sans-serif;
  gap: 40px;
}

/* --- CATALOG HEADER & FILTERS --- */
.catalog-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-title {
  font-size: 3em;
  font-weight: 300;
  margin-bottom: 30px;
  color: #1a1a1a;
}

.filter-bar {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: none;
  padding: 8px 25px;
  font-family: "Cairo", sans-serif;
  font-size: 0.9em;
  cursor: pointer;
  color: #555;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: #aabac4;
  color: white;
}

/* --- PRODUCT GRID --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px 40px;
  margin-bottom: 80px;
}

.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
}

.img-box {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.1));
}

.product-card h3 {
  font-size: 1.1em;
  font-weight: 600;
  color: #4a4a4a;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.color-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.price {
  font-size: 0.95em;
  font-weight: bold;
  color: #666;
}

/* --- NEW COLLECTION SECTION --- */
.new-collection {
  margin-top: 50px;
}

.collection-title {
  font-size: 2.5em;
  font-weight: 300;
  margin-bottom: 40px;
  color: #1a1a1a;
}

.collection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.collection-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.col-img-container {
  width: 100%;
  height: 300px;
  overflow: hidden;
  margin-bottom: 20px;
}

.col-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.collection-item:hover .col-img-container img {
  transform: scale(1.05);
}

.collection-item h3 {
  font-size: 1.4em;
  color: #8fa3a1;
  margin-bottom: 15px;
}

.collection-item p {
  font-size: 0.9em;
  color: #666;
  line-height: 1.5;
  max-width: 80%;
}

/* --- MODAL (POPUP) STYLES --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 30px;
  width: 80%;
  max-width: 800px;
  position: relative;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}

.close-btn:hover {
  color: black;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

/* Modal Left: Images */
.main-image-container {
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.main-image-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Modal Right: Details */
.modal-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-details h2 {
  font-size: 1.8em;
  font-weight: 500;
  color: #333;
  margin-bottom: 10px;
}

.modal-price {
  font-size: 1.6em;
  font-weight: bold;
  color: #000;
  margin-bottom: 15px;
}

.meta-info p {
  font-size: 0.9em;
  margin-bottom: 5px;
}
.free-shipping {
  color: #2ecc71;
  font-weight: bold;
}

.modal-description {
  font-size: 0.95em;
  color: #666;
  line-height: 1.6;
  margin: 20px 0;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.option-group {
  margin-bottom: 20px;
}
.qty-select label {
  display: block;
  font-weight: bold;
  font-size: 0.9em;
  margin-bottom: 8px;
  color: #555;
}

.qty-select input {
  padding: 8px 12px;
  border: 1px solid #ccc;
  width: 60px;
}

.modal-actions {
  display: flex;
  margin-top: 10px;
}

/* Single Cart Button - Full Width */
.btn-cart {
  width: 100%;
  padding: 15px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  background-color: white; /* White background like reference */
  color: #0e0e24; /* Navy Text */
  border: 1px solid #0e0e24; /* Navy Border */
  transition: 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-cart:hover {
  background-color: #0e0e24;
  color: white;
}

/* Product modal tweaks to match reference */
.product-modal .modal-price {
  color: #d17b4f;
}

.product-modal .modal-actions {
  justify-content: flex-start;
}

.product-modal .btn-cart {
  width: auto;
  min-width: 180px;
  padding: 14px 24px;
}

.collection-modal {
  background-color: rgba(33, 29, 27, 0.78);
  padding: 24px;
}

.collection-modal .modal-content {
  width: min(1120px, 100%);
  max-width: 1120px;
  padding: 34px 40px 40px;
  border-radius: 0;
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.22);
}

.collection-modal .close-btn {
  top: 18px;
  right: 22px;
  color: #ababab;
  font-size: 2.7rem;
  font-weight: 400;
}

.collection-modal .close-btn:hover {
  color: #6f6f6f;
}

.collection-modal .modal-body {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 64px;
  align-items: start;
}

.collection-modal .modal-images {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.collection-modal .main-image-container {
  min-height: 470px;
  padding: 32px;
  background: #faf7f3;
  align-items: center;
  justify-content: center;
}

.collection-modal .main-image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.collection-modal .thumbnail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.collection-modal .thumb {
  width: 76px;
  height: 76px;
  object-fit: cover;
  background: #f6f2ed;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.collection-modal .thumb:hover {
  transform: translateY(-2px);
  border-color: #d7b294;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.collection-modal .modal-details {
  min-height: 100%;
  justify-content: flex-start;
  padding-top: 36px;
}

.collection-modal .modal-details h2 {
  font-size: clamp(2.2rem, 2vw, 3rem);
  font-weight: 400;
  color: #383638;
  margin-bottom: 30px;
  line-height: 1.15;
}

.collection-modal .modal-price {
  font-size: clamp(2rem, 2vw, 2.75rem);
  font-weight: 700;
  color: #d17b4f;
  margin-bottom: 24px;
}

.collection-modal .meta-info {
  margin-bottom: 26px;
}

.collection-modal .free-shipping {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.05rem;
  color: #2fc96e;
}

.collection-modal .free-shipping i {
  font-size: 1.05rem;
}

.collection-modal .modal-description {
  margin: 0 0 44px;
  padding-top: 24px;
  border-top: 1px solid #eee6df;
  font-size: 1rem;
  line-height: 1.75;
  color: #6e685f;
}

.collection-modal .modal-actions {
  margin-top: auto;
}

.collection-modal .btn-cart {
  width: min(100%, 420px);
  min-height: 70px;
  padding: 18px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  border: 1px solid #1c1b2d;
  color: #1c1b2d;
  background: #fff;
}

.collection-modal .btn-cart:hover {
  background: #1c1b2d;
  color: #fff;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  main {
    padding: 15px;
    gap: 20px;
  }

  .page-title {
    font-size: 2em;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* Stack Collection items on mobile */
  .collection-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-body {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .main-image-container {
    height: 200px;
  }

  .modal-details h2 {
    font-size: 1.5em;
  }
  .modal-price {
    font-size: 1.3em;
  }

  .product-modal .btn-cart {
    width: 100%;
    min-width: 0;
  }

  .collection-modal {
    padding: 12px;
  }

  .collection-modal .modal-content {
    width: 100%;
    padding: 26px 18px 22px;
  }

  .collection-modal .modal-body {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .collection-modal .main-image-container {
    min-height: 250px;
    padding: 18px;
  }

  .collection-modal .thumbnail-container {
    justify-content: center;
  }

  .collection-modal .modal-details {
    padding-top: 0;
  }

  .collection-modal .btn-cart {
    width: 100%;
  }
}

.floating-cart {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #1c1b1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  z-index: 2100;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.floating-cart i {
  font-size: 1.2rem;
}

.floating-cart-count {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d17b4f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.floating-cart-count.is-hidden {
  display: none;
}
