/**
 * RALENTI UI patterns — grids, mega menu helpers, product cards, responsive
 */

/* Background patterns */
.ralenti-technical-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.ralenti-industrial-grid {
  background-image: radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 40px 40px;
}

.ralenti-dot-grid {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
}

.ralenti-diagonal-texture {
  background: repeating-linear-gradient(
    135deg,
    rgba(229, 38, 41, 0.05) 0,
    rgba(229, 38, 41, 0.05) 1px,
    transparent 1px,
    transparent 10px
  );
}

/* Skewed CTA buttons (add class to Button widget → Advanced → CSS Classes) */
.ralenti-skew-btn .elementor-button {
  transform: skewX(-12deg);
  border-radius: 0;
}

.ralenti-skew-btn .elementor-button-content-wrapper,
.ralenti-skew-btn .elementor-button-text {
  display: inline-block;
  transform: skewX(12deg);
}

/* Header */
.ralenti-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--ralenti-header-height, 80px);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mega menu image tiles (Elementor Image widget inside Menu dropdown) */
.ralenti-mega-tile img {
  filter: grayscale(100%);
  transition: filter 0.5s ease, transform 0.5s ease;
}

.ralenti-mega-tile:hover img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

.ralenti-mega-tile .ralenti-mega-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  font-family: var(--ralenti-font-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

/* Bento cards */
.ralenti-bento-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--ralenti-surface-panel, #1e1e27);
}

.ralenti-bento-card .ralenti-bento-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s ease;
}

.ralenti-bento-card:hover .ralenti-bento-bg {
  transform: scale(1.05);
}

.ralenti-bento-card .ralenti-bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.ralenti-bento-card .ralenti-bento-content {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 2rem;
  z-index: 2;
}

/* Product loop card (Loop Item template) */
.ralenti-product-card {
  background: var(--ralenti-surface-panel, #1e1e27);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  transition: border-color 0.3s ease;
}

.ralenti-product-card:hover {
  border-color: var(--ralenti-racing-red, #e52629);
}

.ralenti-product-card .woocommerce-loop-product__title,
.ralenti-product-card .elementor-heading-title {
  font-family: var(--ralenti-font-headline, sans-serif);
}

/* Spotlight glow */
.ralenti-spotlight-glow {
  position: relative;
}

.ralenti-spotlight-glow::before {
  content: "";
  position: absolute;
  inset: 10%;
  background: rgba(229, 38, 41, 0.2);
  filter: blur(100px);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

.ralenti-spotlight-glow img {
  position: relative;
  z-index: 1;
}

/* Forms */
.ralenti-form-panel input,
.ralenti-form-panel select,
.ralenti-form-panel textarea {
  background: var(--ralenti-surface-deep, #000) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: var(--ralenti-on-surface, #e2e2e2) !important;
  border-radius: 0 !important;
}

.ralenti-form-panel input:focus,
.ralenti-form-panel select:focus,
.ralenti-form-panel textarea:focus {
  border-bottom-color: var(--ralenti-racing-red, #e52629) !important;
  box-shadow: none !important;
}

/* Offset for fixed header */
.ralenti-page-offset {
  padding-top: var(--ralenti-header-height, 80px);
}

/* Responsive */
@media (max-width: 1024px) {
  .ralenti-hide-tablet {
    display: none !important;
  }

  .ralenti-stack-tablet {
    flex-direction: column !important;
  }
}

@media (max-width: 767px) {
  .ralenti-hero {
    min-height: 70vh !important;
  }

  .ralenti-bento-large {
    min-height: 320px !important;
  }

  .ralenti-bento-small {
    min-height: 280px !important;
  }

  .ralenti-shop-layout {
    grid-template-columns: 1fr !important;
  }

  .ralenti-contact-title {
    font-size: clamp(2.5rem, 10vw, 4rem) !important;
  }
}

/* Selection */
.ralenti-site ::selection {
  background: #e52629;
  color: #fff;
}
