/* ============================================
   ООО "ЭМК" - Custom Bootstrap 5.3 Theme
   Orange-based warm industrial theme
   ============================================ */

/* CSS Custom Properties (Bootstrap Overrides) */
:root {
  /* Primary Colors */
  --bs-primary: #E8601A;
  --bs-primary-hover: #D45414;
  --bs-primary-active: #BF480F;
  --bs-primary-disabled: #F1A178;
  --bs-primary-rgb: 232, 96, 26;
  
  /* Secondary Colors */
  --bs-secondary: #F19311;
  --bs-secondary-hover: #DB830E;
  --bs-secondary-active: #C5730C;
  --bs-secondary-disabled: #F6C980;
  --bs-secondary-rgb: 241, 147, 17;
  
  /* Dark Colors */
  --bs-dark: #222222;
  --bs-dark-hover: #1A1A1A;
  --bs-dark-active: #000000;
  --bs-dark-rgb: 34, 34, 34;
  
  /* Muted Colors */
  --bs-gray: #808080;
  --bs-gray-light: #B3B3B3;
  --bs-gray-dark: #5C5C5C;
  
  /* Light Colors */
  --bs-light: #F5F5F5;
  --bs-light-rgb: 245, 245, 245;
  
  /* Background Colors */
  --bs-body-bg: #FFFFFF;
  --bs-body-color: #222222;
  
  /* Link Colors */
  --bs-link-color: #E8601A;
  --bs-link-hover-color: #F19311;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #E8601A 0%, #F19311 100%);
  --gradient-primary-hover: linear-gradient(135deg, #D45414 0%, #DB830E 100%);
  --gradient-primary-active: linear-gradient(135deg, #BF480F 0%, #C5730C 100%);
  
  /* Form Focus */
  --bs-focus-border-color: #E8601A;
  --bs-focus-box-shadow: 0 0 0 0.25rem rgba(232, 96, 26, 0.25);
  
  /* Typography */
  --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.6;
}

/* ============================================
   Preloader
   ============================================ */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.loaded {
  opacity: 0;
  visibility: hidden;
}

.preloader-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--bs-light);
  border-top-color: var(--bs-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Base Typography
   ============================================ */
body {
  font-family: var(--bs-font-sans-serif);
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  line-height: var(--bs-body-line-height);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700;
  color: var(--bs-dark);
  margin-bottom: 1rem;
}

h1, .h1 { font-size: 2.5rem; }
h2, .h2 { font-size: 2rem; }
h3, .h3 { font-size: 1.75rem; }
h4, .h4 { font-size: 1.5rem; }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }

@media (min-width: 992px) {
  h1, .h1 { font-size: 3rem; }
  h2, .h2 { font-size: 2.5rem; }
  h3, .h3 { font-size: 2rem; }
}

p {
  margin-bottom: 1rem;
  color: var(--bs-gray-dark);
}

a {
  color: var(--bs-link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--bs-link-hover-color);
  text-decoration: underline;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--gradient-primary);
  border: none;
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--gradient-primary-hover);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(232, 96, 26, 0.35);
}

.btn-primary:active,
.btn-primary:focus {
  background: var(--gradient-primary-active);
  color: #FFFFFF;
  box-shadow: var(--bs-focus-box-shadow);
}

.btn-primary:disabled {
  background: var(--bs-primary-disabled);
  opacity: 0.7;
}

.btn-secondary {
  background-color: var(--bs-secondary);
  border-color: var(--bs-secondary);
  color: var(--bs-dark);
}

.btn-secondary:hover {
  background-color: var(--bs-secondary-hover);
  border-color: var(--bs-secondary-hover);
  color: var(--bs-dark);
}

.btn-outline-primary {
  color: var(--bs-primary);
  border-color: var(--bs-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  border-color: var(--bs-primary);
  color: #FFFFFF;
}

.btn-dark {
  background-color: var(--bs-dark);
  border-color: var(--bs-dark);
  color: #FFFFFF;
}

.btn-dark:hover {
  background-color: var(--bs-dark-hover);
  border-color: var(--bs-dark-hover);
}

/* ============================================
   Header / Navbar
   ============================================ */
.navbar {
  padding: 1rem 0;
  background-color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--bs-dark) !important;
}

.navbar-brand span {
  color: var(--bs-primary);
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--bs-dark);
  padding: 0.5rem 1rem;
  position: relative;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--bs-primary);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
  transform: scaleX(1);
}

.header-phone {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--bs-dark);
}

.header-phone i {
  color: var(--bs-primary);
  margin-right: 0.5rem;
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23E8601A' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background-color: var(--bs-dark);
  color: #FFFFFF;
  padding: 3rem 0 1.5rem;
}

.footer h5 {
  color: #FFFFFF;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.footer p,
.footer a {
  color: var(--bs-gray-light);
}

.footer a:hover {
  color: var(--bs-secondary);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--bs-gray-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--bs-secondary);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.875rem;
}

/* ============================================
   Hero / Main Page Grid
   ============================================ */
.hero-grid {
  padding: 0;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 350px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(34, 34, 34, 0.9) 0%, rgba(34, 34, 34, 0.3) 50%, transparent 100%);
  transition: background 0.3s ease;
}

.hero-card:hover::before {
  background: linear-gradient(to top, rgba(232, 96, 26, 0.9) 0%, rgba(232, 96, 26, 0.5) 50%, transparent 100%);
}

.hero-card-content {
  position: relative;
  z-index: 1;
  padding: 2rem;
  color: #FFFFFF;
  width: 100%;
}

.hero-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #FFFFFF;
}

.hero-card-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  line-height: 1.5;
}

@media (min-width: 992px) {
  .hero-card {
    min-height: 400px;
  }
  
  .hero-card-title {
    font-size: 1.75rem;
  }
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
  background: var(--bs-light);
  padding: 4rem 0;
  margin-bottom: 3rem;
}

.page-header h1 {
  margin-bottom: 0;
}

.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
  margin-top: 1rem;
}

.breadcrumb-item a {
  color: var(--bs-gray);
}

.breadcrumb-item.active {
  color: var(--bs-primary);
}

/* ============================================
   Timeline (History Page)
   ============================================ */
.timeline {
  position: relative;
  padding: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  width: 50%;
  padding-right: 3rem;
}

.timeline-item:nth-child(even) {
  margin-left: 50%;
  padding-right: 0;
  padding-left: 3rem;
}

.timeline-dot {
  position: absolute;
  right: -12px;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--gradient-primary);
  border-radius: 50%;
  border: 4px solid #FFFFFF;
  box-shadow: 0 0 0 4px var(--bs-primary);
}

.timeline-item:nth-child(even) .timeline-dot {
  right: auto;
  left: -12px;
}

.timeline-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bs-primary);
  margin-bottom: 0.5rem;
}

.timeline-content {
  background: #FFFFFF;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.timeline-content p {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .timeline::before {
    left: 12px;
  }
  
  .timeline-item,
  .timeline-item:nth-child(even) {
    width: 100%;
    margin-left: 0;
    padding-left: 3rem;
    padding-right: 0;
  }
  
  .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    left: 0;
    right: auto;
  }
}

/* ============================================
   Content Sections
   ============================================ */
.section {
  padding: 4rem 0;
}

.section-light {
  background-color: var(--bs-light);
}

.section-title {
  margin-bottom: 2rem;
}

.content-card {
  background: #FFFFFF;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.content-card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1.25rem;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.content-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.content-card ul {
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.content-card li {
  margin-bottom: 0.5rem;
  color: var(--bs-gray-dark);
}

/* ============================================
   Certificates Gallery
   ============================================ */
.certificate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.certificate-item {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.certificate-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.certificate-item img {
  width: 100%;
  height: auto;
  display: block;
}

.certificate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(232, 96, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.certificate-item:hover .certificate-overlay {
  opacity: 1;
}

.certificate-overlay i {
  font-size: 2rem;
  color: #FFFFFF;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--bs-primary);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gradient-primary);
  border: none;
  color: #FFFFFF;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.lightbox-nav:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: -70px;
}

.lightbox-next {
  right: -70px;
}

.lightbox-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: #FFFFFF;
  font-size: 0.875rem;
}

@media (max-width: 767.98px) {
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
}

/* ============================================
   Contact Page
   ============================================ */
.contact-info {
  background: var(--bs-light);
  padding: 2rem;
  border-radius: 0.5rem;
  height: 100%;
}

.contact-info h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bs-primary);
}

.contact-detail {
  margin-bottom: 1rem;
}

.contact-detail strong {
  color: var(--bs-dark);
  display: block;
  margin-bottom: 0.25rem;
}

.contact-detail span,
.contact-detail a {
  color: var(--bs-gray-dark);
}

.contact-form {
  background: #FFFFFF;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.contact-form h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ============================================
   Forms
   ============================================ */
.form-control,
.form-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--bs-light);
  border-radius: 0.5rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: var(--bs-focus-box-shadow);
}

.form-control:disabled {
  background-color: var(--bs-light);
}

.form-label {
  font-weight: 500;
  color: var(--bs-dark);
  margin-bottom: 0.5rem;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

/* ============================================
   Utilities
   ============================================ */
.text-primary {
  color: var(--bs-primary) !important;
}

.text-secondary {
  color: var(--bs-secondary) !important;
}

.bg-primary {
  background: var(--gradient-primary) !important;
}

.bg-secondary {
  background-color: var(--bs-secondary) !important;
}

.bg-light {
  background-color: var(--bs-light) !important;
}

.bg-dark {
  background-color: var(--bs-dark) !important;
}

/* Spacing */
.py-section {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

/* ============================================
   Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Logo Styling
   ============================================ */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1.25rem;
}

/* ============================================
   Hero Cards Enhanced
   ============================================ */
.hero-card {
  cursor: pointer;
}

.hero-card-content {
  transform: translateY(10px);
  transition: transform 0.3s ease;
}

.hero-card:hover .hero-card-content {
  transform: translateY(0);
}

.hero-card-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
}

.hero-card-icon i {
  font-size: 1.5rem;
  color: #FFFFFF;
}

/* ============================================
   Page Transitions
   ============================================ */
.page-transition {
  animation: pageIn 0.5s ease forwards;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Scroll to Top Button
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(232, 96, 26, 0.4);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(232, 96, 26, 0.5);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: #FFFFFF;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }
  
  .header-phone {
    margin-top: 1rem;
    text-align: center;
  }
  
  .page-header {
    padding: 3rem 0;
  }
  
  .section {
    padding: 3rem 0;
  }
}

@media (max-width: 575.98px) {
  h1, .h1 { font-size: 2rem; }
  h2, .h2 { font-size: 1.75rem; }
  h3, .h3 { font-size: 1.5rem; }
  
  .hero-card {
    min-height: 300px;
  }
  
  .hero-card-title {
    font-size: 1.25rem;
  }
  
  .content-card {
    padding: 1.5rem;
  }
}
@media (min-width: 1920px) {
  .hero-card {
    min-height: calc((100vh - 76px - 200px) / 2);
  }
}
