/* Step 2 - Choose Furniture Stylesheet */

/* Grid Catalog Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  justify-content: center;
}

/* Category Headers */
.category-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  margin-bottom: 12px;
}
.category-header h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--color-dark);
  white-space: nowrap;
}
.category-header .category-line {
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}
.category-header:first-of-type {
  margin-top: 10px;
}

/* Furniture Cards */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    border-color 0.3s ease,
    background-color 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

/* Checkbox positioned in card footer row */
.card .premium-checkbox-wrapper {
  position: relative !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 2 !important;
  margin: 0 !important;
}

/* Hover Animation on Desktop Only */
@media (min-width: 1200px) {
  .card:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-md);
  }
  .card:hover .image-container img {
    transform: scale(1.04);
  }
  .card:hover .card-glow {
    opacity: 1;
  }
}

.card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 0,
    var(--color-terracotta-glow),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 1;
}

.image-container {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: var(--color-pure-white);
  display: block;
  padding: 0;
  border-bottom: 1px solid rgba(166, 75, 42, 0.08);
}
.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s;
}

.item-icon-tag {
  display: none !important;
}

.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: left;
}

.card-header-flex {
  display: none !important;
}
.card-content h3 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 4px 0;
}
.card-content .desc {
  font-size: 0.82rem;
  color: var(--color-dark-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
}

/* Premium Checkbox */
.premium-checkbox-wrapper {
  position: relative;
  cursor: pointer;
  display: inline-block;
  width: 24px;
  height: 24px;
}
.premium-checkbox-wrapper input {
  opacity: 0;
  width: 0;
  height: 0;
}
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 24px;
  width: 24px;
  border-radius: 4px;
  border: 1.5px solid var(--color-border);
  background: var(--color-pure-white);
  transition: 0.3s;
}
.premium-checkbox-wrapper:hover input ~ .checkmark {
  border-color: var(--color-terracotta);
}
.premium-checkbox-wrapper input:checked ~ .checkmark {
  background: var(--color-terracotta);
  border-color: var(--color-terracotta);
}
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--color-pure-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.premium-checkbox-wrapper input:checked ~ .checkmark:after {
  display: block;
}

/* Card Controls Footer Row */
.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.quantity-controller {
  display: flex;
  align-items: center;
  background: #734533;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  gap: 10px;
}
.quantity-controller button {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  padding: 0;
}
.quantity-controller button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}
.quantity-controller .qty-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  min-width: 12px;
  text-align: center;
}

.item-subtotal {
  display: none !important;
  flex-direction: column;
  text-align: right;
}
.subtotal-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-dark-muted);
}
.subtotal-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-terracotta);
}

/* Selected Status Styling */
.card.selected {
  border-color: var(--color-terracotta) !important;
  background-color: rgba(166, 75, 42, 0.04) !important;
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(166, 75, 42, 0.12) !important;
}

/* Disabled Status Styling */
.card.disabled-card {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(80%);
}

/* Sticky bottom navigation override */
.sticky-footer-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  background-color: var(--color-white) !important;
  border-top: 1px solid var(--color-border) !important;
  padding: 12px 0 !important;
  z-index: 1000 !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05) !important;
}

/* --- MOBILE & TABLET RESPONSIVENESS --- */

/* Landscape Tablet View: 992px to 1199px */
@media (min-width: 992px) and (max-width: 1199px) {
  .grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px !important;
  }
  .card {
    height: 260px !important;
  }
  .image-container {
    height: 150px !important;
  }
  .card-content {
    padding: 16px !important;
  }
  .card-content .desc {
    font-size: 0.75rem !important;
    margin-bottom: 12px !important;
  }
}

/* Portrait Tablet View: 768px to 991px */
@media (min-width: 769px) and (max-width: 991px) {
  .grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
  }
  .card {
    height: 240px !important;
  }
  .image-container {
    height: 140px !important;
  }
  .card-content {
    padding: 12px !important;
  }
  .card-content .desc {
    display: none !important; /* Hide descriptions to reduce page height */
  }
}

/* Mobile View: up to 768px */
@media (max-width: 768px) {
  .step-title-block h1 {
    font-size: 1.8rem !important; /* 25% reduction in heading size */
  }
  .step-title-block p {
    font-size: 0.9rem !important;
  }

  .category-header {
    margin-top: 25px !important; /* Reduce vertical spacing */
    margin-bottom: 8px !important;
    gap: 10px !important;
  }
  .category-header h2 {
    font-size: 1.15rem !important; /* 18-20px category headings */
  }

  .grid {
    grid-template-columns: repeat(
      2,
      1fr
    ) !important; /* exactly 2 cards per row */
    gap: 12px !important;
  }

  .card {
    height: auto !important;
    min-height: 200px !important;
    padding: 0 !important;
  }

  .image-container {
    height: 125px !important; /* ~62% of card height */
    padding: 0 !important;
    border-bottom: 1px solid rgba(166, 75, 42, 0.04);
  }
  .image-container img {
    width: 100% !important;
    height: 100% !important;
    max-height: unset !important;
    object-fit: cover !important;
  }

  .item-icon-tag {
    display: none !important; /* Hide floating tags to make layout clean */
  }

  .card-content {
    padding: 8px 10px !important; /* Reduced padding */
  }
  .card-header-flex {
    display: none !important;
  }
  .card-content h3 {
    font-size: 15px !important; /* 15-16px furniture name */
    font-weight: 600 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
  .card-content .desc {
    display: none !important; /* Hide description to prevent overflows and scroll */
  }

  .card-footer-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: auto !important;
    padding-top: 4px !important;
  }

  .quantity-controller {
    padding: 2px !important;
    gap: 6px !important;
  }
  .quantity-controller button {
    width: 22px !important;
    height: 22px !important;
    font-size: 0.75rem !important;
  }
  .quantity-controller .qty-val {
    font-size: 0.85rem !important;
    min-width: 12px !important;
  }

  .item-subtotal .subtotal-label {
    font-size: 0.58rem !important;
  }
  .item-subtotal .subtotal-value {
    font-size: 0.92rem !important;
  }
}

/* Inspiration Gallery Styles */
.inspiration-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 15px;
  width: 100%;
}
.inspiration-card {
  position: relative;
  background: var(--color-pure-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}
.inspiration-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-terracotta);
  box-shadow: var(--shadow-md);
}
.inspiration-img-wrapper {
  width: 100%;
  height: 140px;
  overflow: hidden;
  position: relative;
}
.inspiration-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}
.inspiration-card:hover .inspiration-img-wrapper img {
  transform: scale(1.05);
}
.inspiration-card h4 {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-dark);
  text-align: center;
  padding: 12px 10px;
  margin: 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
}
@media (max-width: 991px) {
  .inspiration-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}
@media (max-width: 480px) {
  .inspiration-gallery-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .inspiration-img-wrapper {
    height: 150px;
  }
}
