/* ============================================================
   TERRA MAX - WYNAJEM STYLES
   Extends: home.css
   ============================================================ */

/* ==================== PAGE HERO (Common) ==================== */
.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 0;
  padding-bottom: 60px; /* Added for consistency with kontakt.html */
}

.page-hero__background {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.page-hero__background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(30, 30, 30, 0.9) 0%,
    rgba(30, 30, 30, 0.6) 100%
  );
}
.page-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--color-primary);
  clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 100%);
  z-index: 2;
}
.page-hero__content {
  position: relative;
  z-index: 3;
  padding-top: 100px; /* Increased from 60px for better spacing from header when zoomed */
}
.page-hero__title {
  color: var(--color-white);
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin-bottom: 15px;
}
.page-hero__subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.2rem;
  max-width: 600px;
  border-left: 4px solid var(--color-primary);
  padding-left: 20px;
}

/* ==================== FILTERS ==================== */
.rental-filters {
  padding: 40px 0 0;
  background: #fff;
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 10px 25px;
  border: 1px solid #ddd;
  background: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  /* Clip corners */
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--color-dark);
  color: var(--color-white);
  border-color: var(--color-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ==================== MACHINES GRID ==================== */
.machines {
  padding: 70px 0;
  background: #f8f9fb;
}

.machines__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

/* Tech Card (Machine) */
.tech-card {
  position: relative;
  background: #fff;
  border: 1px solid #e8ebf0;
  display: flex;
  flex-direction: column;
  transition: all 0.35s var(--ease-tech);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
  isolation: isolate;
}

.tech-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.tech-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(245, 195, 0, 0.25);
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tech-card:hover::before {
  opacity: 1;
}

.tech-card__image-box {
  position: relative;
  height: 220px;
  background: linear-gradient(180deg, #fdf8e6, #ffffff 60%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

.tech-card__image-box img {
  width: 85%;
  height: 85%;
  object-fit: contain; /* Show whole machine */
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.12));
  transition: transform 0.5s ease, filter 0.4s ease;
}

.tech-card:hover .tech-card__image-box img {
  transform: translateY(-4px) scale(1.05);
  filter: drop-shadow(0 14px 22px rgba(15, 23, 42, 0.18));
}

.tech-card:hover .tech-card__image-box {
  transform: translateY(-2px);
}

.tech-card__body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tech-card__title {
  font-size: 1.2rem;
  margin-bottom: 0;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.tech-card__subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Specs Table */
.specs-table {
  width: 100%;
  margin-bottom: 15px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.specs-table td {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.specs-table tr:last-child td {
  border-bottom: none;
}

.specs-table td:first-child {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.specs-table td:last-child {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
}

.tech-card__body .btn {
  margin-top: auto;
  background: linear-gradient(135deg, #f5c300, #f0a500);
  color: #0f172a;
  border: none;
  box-shadow: 0 10px 25px rgba(245, 195, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tech-card__body .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(245, 195, 0, 0.35);
}

/* ==================== RENTAL RULES ==================== */
.rental-rules {
  background: var(--color-dark);
  color: #fff;
  padding: 80px 0;
}

.rules-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.rule-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.rule-number {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.1);
  line-height: 1;
  margin-bottom: -20px;
  position: relative;
  z-index: 1;
}

.rule-step h4 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  position: relative;
  z-index: 2;
  color: var(--color-primary);
}

.rule-step p {
  color: #aaa;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

/* Connector Lines */
.rule-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 40%;
  right: -20px;
  width: 40px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(50%);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
  .machines__grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .rules-grid {
    flex-direction: column;
    gap: 60px;
  }
  .rule-step:not(:last-child)::after {
    display: none; /* No lines on mobile */
  }
  .rental-filters {
    padding-bottom: 20px;
  }
  .filter-bar {
    gap: 10px;
    flex-wrap: wrap;
  }
  .filter-chip {
    font-size: 12px;
    padding: 8px 18px;
  }
  .machines__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .tech-card__image-box {
    height: 200px;
  }
}

/* ==================== RENTAL CTA ==================== */
.rental-cta {
  padding: 60px 0;
  background: var(--color-primary);
  color: var(--color-dark);
  margin-top: 0;
}

.rental-cta__inner {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.rental-cta__inner h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--color-dark);
}

.rental-cta__inner p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #333;
  font-weight: 500;
}

/* Specific button override for this section to stand out against yellow bg */
.rental-cta .btn--secondary {
  background: var(--color-dark);
  color: #fff;
  border: 2px solid var(--color-dark);
}

.rental-cta .btn--secondary:hover {
  background: transparent;
  color: var(--color-dark);
}

@media (max-width: 768px) {
  .rental-cta__inner h2 {
    font-size: 2rem;
  }
}
