/* =======================
   VARIABLES
======================= */
:root {
  --primary: #0d6efd;
}

/* =======================
   GLOBAL STYLES
======================= */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #ffffff;
  color: #212529;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

/* =======================
   ALERTS / MESSAGES
======================= */
.alert,
.message-alert {
  background: #e7f1ff;
  color: var(--primary);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-weight: 500;
  text-align: center;
}

/* =======================
   PRODUCT LAYOUT
======================= */
.product-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  text-align: center;
}

/* =======================
   PRODUCT INFO
======================= */
.product-info h1 {
  margin-top: 0;
  font-size: 28px;
}

.price {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  margin: 10px 0;
}

.shop {
  margin-bottom: 15px;
  font-size: 15px;
}

.shop a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.description {
  line-height: 1.7;
  color: #495057;
  margin-bottom: 25px;
}

/* =======================
   ACTION BUTTONS (FIXED)
======================= */
.actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}


.btn-cart {
    padding: 12px 22px;
  border-radius: 6px;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary); /* force background */
  color: #fff;
}

.btn-cart:hover {
  background-color: #084298;
}

.btn-whatsapp {
    padding: 12px 22px;
  border-radius: 6px;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #099e40; /* force background */
  color: #fff;
  
}

.btn-whatsapp:hover {
  opacity: 0.9;
}

/* =======================
   IMAGE GRID
======================= */
.image-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.image-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #ddd;
  background: #f8f9fa;
  cursor: pointer;
}

/* SINGLE IMAGE MODE */
.image-grid.single-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-grid.single-image img {
  max-width: 420px;
  height: 280px;
  border-radius: 10px;
}

/* NO IMAGE PLACEHOLDER */
.no-image {
  height: 240px;
  border: 2px dashed #ced4da;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 14px;
  padding: 1rem;
}

/* =======================
   IMAGE MODAL (FULLSCREEN)
======================= */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0,0,0,0.85);
  overflow: hidden;
  text-align: center;
  align-items: center;
  justify-content: center;
}

.image-modal.active {
  display: flex;
}

.image-modal img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 0; /* optional: no rounding */
  transition: opacity 0.5s ease-in-out;
}

/* MODAL CLOSE BUTTON */
.image-modal .close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}

/* MODAL NAVIGATION ARROWS */
.image-modal .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.2);
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 30px;
  z-index: 10;
}

.image-modal .arrow.left { left: 10px; }
.image-modal .arrow.right { right: 10px; }

/* =======================
   RESPONSIVE STYLES
======================= */
@media (max-width: 768px) {
  /* Layout */
  .product-wrapper {
    grid-template-columns: 1fr;
  }

  /* Image grid smaller on mobile */
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .image-grid img {
    height: 160px;
  }

  /* Single image mode responsive */
  .image-grid.single-image img {
    max-width: 90%;
    height: auto;
  }

  /* Modal image responsive */
  .image-modal img {
    width: 95vw;
    border-radius: 10px;
  }

  /* Product info alignment */
  .product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
}
