/* --- Interactive Layout & Global Components --- */
:root {
  --bg-color: #f5f5f7;
  --card-width: 450px;
  --clr-1: #7000ff;
  --clr-2: #ff0055;
  --clr-3: #ff00c8;
  --clr-4: #ffe605;
}

/* --- Modern Responsive Grid --- */
/* --- Stable 3-Column Grid --- */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1200px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .masonry-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Lightbox (Image Zoom) --- */
.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.lightbox.active { opacity: 1; pointer-events: auto; }

.lightbox-content-wrapper {
  position: relative;
  width: 100%; height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
}

.lightbox-content-wrapper.grabbing { cursor: grabbing; }

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 5px;
  box-shadow: 0 0 40px rgba(112, 0, 255, 0.4);
  transition: transform 0.1s ease-out;
}

.close-lightbox {
  position: absolute;
  top: 25px; left: 25px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 35px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 3010;
}

.zoom-instruction {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 3010;
}

/* --- Specs Modal --- */
.specs-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(10px);
}

.specs-modal.active { opacity: 1; pointer-events: auto; }

.specs-modal-content {
  background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
  border-radius: 25px;
  padding: 30px;
  width: 95%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(123, 31, 162, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.specs-modal.active .specs-modal-content { transform: scale(1); }

.specs-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.specs-modal-title { 
  font-size: 1.4rem; 
  font-weight: 800; 
  color: white; 
  font-family: 'Cairo', sans-serif;
}

.close-specs-modal {
  background: rgba(255, 255, 255, 0.1); 
  border: none;
  color: white;
  font-size: 24px; 
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s;
}

.close-specs-modal:hover {
  background: rgba(255, 255, 255, 0.2);
}

.specs-image-container {
  width: 100%; 
  height: 350px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 25px;
  position: relative;
  cursor: zoom-in;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.specs-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.specs-image-container:hover .specs-image {
  transform: scale(1.02);
}

/* --- Modal Specification Layouts --- */
.spec-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-section-title {
  color: var(--clr-4);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.spec-value {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
}

.spec-full-row {
  margin-top: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.spec-full-row strong {
  display: block;
  color: white;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.spec-full-row p {
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Re-using Tender components inside modal */
.specs-modal .request-banner-premium {
  margin-top: 0;
  margin-bottom: 20px;
  border-radius: 15px;
}

.specs-modal .request-stats-grid {
  margin-bottom: 20px;
}

/* --- Sizes Table --- */
.sizes-table-wrapper {
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  width: 100%;
}

.sizes-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 14px;
}

.sizes-table th {
  background: #fcfcfc;
  color: #1a1a1a;
  font-weight: 700;
  padding: 12px 15px;
  border-bottom: 2px solid #e0e0e0;
}

.sizes-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
  color: #666;
}

/* --- Floating Action Button --- */
.publish-btn-fixed {
  position: fixed;
  bottom: 30px; left: 30px;
  background: linear-gradient(135deg, var(--clr-1), var(--clr-2));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 15px 30px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(112, 0, 255, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

/* --- Publish/Offer Modal --- */
.publish-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.publish-modal.active { opacity: 1; pointer-events: auto; }

.publish-modal-content {
  background: #1a1a1a;
  border-radius: 20px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(112, 0, 255, 0.4);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.form-group-modal { margin-bottom: 20px; }
.form-group-modal label { display: block; color: rgba(255, 255, 255, 0.9); margin-bottom: 8px; font-weight: 600; }
.form-group-modal input, .form-group-modal select, .form-group-modal textarea {
  width: 100%; padding: 12px 15px;
  border: 2px solid rgba(112, 0, 255, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: white !important;
}

.submit-btn-modal {
  width: 100%;
  background: linear-gradient(135deg, #ff8a00, #ff5e00) !important;
  color: white !important;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 138, 0, 0.25);
  transition: all 0.25s ease;
}

.submit-btn-modal:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 138, 0, 0.35) !important;
}
