/* ============================================================
   DoorFixMaster - Modern UI Override Stylesheet
   Loaded AFTER Kadence/Elementor CSS to override appearance
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --dfm-primary: #2B6CB0;
  --dfm-primary-dark: #1a4f8a;
  --dfm-primary-light: #3b82f6;
  --dfm-accent: #f59e0b;
  --dfm-dark: #0f172a;
  --dfm-gray-900: #1a202c;
  --dfm-gray-700: #374151;
  --dfm-gray-500: #6b7280;
  --dfm-gray-300: #d1d5db;
  --dfm-gray-100: #f3f4f6;
  --dfm-white: #ffffff;
  --dfm-red: #dc2626;
  --dfm-green: #16a34a;
  --dfm-radius: 12px;
  --dfm-radius-sm: 8px;
  --dfm-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --dfm-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --dfm-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --dfm-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --dfm-max-width: 1200px;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.dfm-top-bar {
  background: linear-gradient(135deg, var(--dfm-primary-dark) 0%, var(--dfm-primary) 100%);
  color: var(--dfm-white);
  padding: 8px 0;
  font-size: 13px;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 200;
}
.dfm-top-bar-inner {
  max-width: var(--dfm-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.dfm-top-bar a {
  color: var(--dfm-white);
  text-decoration: none;
  font-weight: 600;
  background: rgba(255,255,255,0.15);
  padding: 4px 14px;
  border-radius: 20px;
  transition: var(--dfm-transition);
}
.dfm-top-bar a:hover {
  background: rgba(255,255,255,0.3);
}
.dfm-top-bar .dfm-top-bar-badge {
  background: var(--dfm-accent);
  color: var(--dfm-dark);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  animation: dfm-pulse 2s infinite;
}
@keyframes dfm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@media (max-width: 767px) {
  .dfm-top-bar-inner {
    justify-content: center;
    text-align: center;
    font-size: 12px;
  }
  .dfm-top-bar .dfm-top-bar-text { display: none; }
}

/* ============================================================
   HEADER ENHANCEMENT
   ============================================================ */
#masthead.dfm-header-sticky {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  box-shadow: var(--dfm-shadow-lg);
  background: rgba(255,255,255,0.98) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--dfm-transition);
}
#masthead.dfm-header-sticky + * {
  padding-top: 80px;
}
#masthead.dfm-header-sticky .site-main-header-inner-wrap {
  min-height: 60px !important;
}

/* ============================================================
   RICH FOOTER
   ============================================================ */
.dfm-rich-footer {
  background: var(--dfm-dark);
  color: var(--dfm-gray-300);
  padding: 60px 0 40px;
  font-size: 14px;
  line-height: 1.8;
}
.dfm-footer-inner {
  max-width: var(--dfm-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.dfm-rich-footer h4 {
  color: var(--dfm-white);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--dfm-primary);
  display: inline-block;
}
.dfm-rich-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dfm-rich-footer ul li {
  margin-bottom: 8px;
}
.dfm-rich-footer ul li a {
  color: var(--dfm-gray-300);
  text-decoration: none;
  transition: var(--dfm-transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dfm-rich-footer ul li a:hover {
  color: var(--dfm-white);
  padding-left: 4px;
}
.dfm-rich-footer ul li a::before {
  content: "›";
  font-weight: 700;
  color: var(--dfm-primary-light);
}
.dfm-rich-footer .dfm-footer-contact p {
  margin: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.dfm-footer-contact a {
  color: var(--dfm-primary-light);
  text-decoration: none;
}
.dfm-footer-contact a:hover {
  color: var(--dfm-white);
}
.dfm-footer-bottom {
  max-width: var(--dfm-max-width);
  margin: 40px auto 0;
  padding: 20px 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
  color: var(--dfm-gray-500);
}

@media (max-width: 1024px) {
  .dfm-footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}
@media (max-width: 767px) {
  .dfm-footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .dfm-rich-footer {
    padding: 40px 0 24px;
  }
}

/* Hide original simple footer (keep in DOM for accessibility) */
#colophon .site-footer-wrap {
  display: none;
}

/* ============================================================
   FAQ SECTION
   ============================================================ */
.dfm-faq-section {
  margin: 48px 0 32px;
  padding: 40px;
  background: var(--dfm-gray-100);
  border-radius: var(--dfm-radius);
}
.dfm-faq-section h2 {
  font-size: 24px;
  color: var(--dfm-gray-900);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dfm-faq-section h2::before {
  content: "❓";
  font-size: 28px;
}
.dfm-faq-item {
  background: var(--dfm-white);
  border-radius: var(--dfm-radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--dfm-shadow);
  overflow: hidden;
  transition: var(--dfm-transition);
}
.dfm-faq-item:hover {
  box-shadow: var(--dfm-shadow-md);
}
.dfm-faq-question {
  padding: 18px 24px;
  font-weight: 600;
  color: var(--dfm-gray-900);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  font-size: 15px;
}
.dfm-faq-question::after {
  content: "+";
  font-size: 22px;
  font-weight: 300;
  color: var(--dfm-primary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}
.dfm-faq-item.active .dfm-faq-question::after {
  transform: rotate(45deg);
}
.dfm-faq-answer {
  display: none;
  padding: 0 24px 18px;
  color: var(--dfm-gray-700);
  line-height: 1.7;
  font-size: 14px;
}
.dfm-faq-item.active .dfm-faq-answer {
  display: block;
}

@media (max-width: 767px) {
  .dfm-faq-section {
    padding: 24px 16px;
    margin: 32px 0 24px;
  }
}

/* ============================================================
   CTA BANNER
   ============================================================ */
.dfm-cta-banner {
  margin: 40px 0;
  background: linear-gradient(135deg, var(--dfm-primary) 0%, var(--dfm-primary-dark) 100%);
  border-radius: var(--dfm-radius);
  overflow: hidden;
  position: relative;
}
.dfm-cta-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.dfm-cta-inner {
  padding: 40px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.dfm-cta-inner h3 {
  color: var(--dfm-white);
  font-size: 26px;
  margin-bottom: 12px;
}
.dfm-cta-inner p {
  color: rgba(255,255,255,0.85);
  font-size: 16px;
  margin-bottom: 24px;
}
.dfm-cta-btn {
  display: inline-block;
  background: var(--dfm-white);
  color: var(--dfm-primary-dark);
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--dfm-transition);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.dfm-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  background: var(--dfm-accent);
  color: var(--dfm-dark);
}
.dfm-cta-btn-secondary {
  display: inline-block;
  color: var(--dfm-white);
  border: 2px solid rgba(255,255,255,0.4);
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  margin-left: 16px;
  transition: var(--dfm-transition);
}
.dfm-cta-btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.7);
  color: var(--dfm-white);
}

@media (max-width: 767px) {
  .dfm-cta-inner {
    padding: 28px 20px;
  }
  .dfm-cta-inner h3 {
    font-size: 20px;
  }
  .dfm-cta-btn {
    padding: 12px 28px;
    font-size: 16px;
    display: block;
  }
  .dfm-cta-btn-secondary {
    display: block;
    margin-left: 0;
    margin-top: 12px;
  }
}

/* ============================================================
   RELATED SERVICES
   ============================================================ */
.dfm-related-services {
  margin: 40px 0;
}
.dfm-related-services h3 {
  font-size: 20px;
  color: var(--dfm-gray-900);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dfm-related-services h3::before {
  content: "🔗";
}
.dfm-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.dfm-service-card {
  background: var(--dfm-white);
  border: 1px solid var(--dfm-gray-300);
  border-radius: var(--dfm-radius-sm);
  padding: 20px;
  text-decoration: none;
  color: var(--dfm-gray-900);
  transition: var(--dfm-transition);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 14px;
}
.dfm-service-card:hover {
  border-color: var(--dfm-primary);
  box-shadow: var(--dfm-shadow-md);
  transform: translateY(-2px);
  color: var(--dfm-primary);
}
.dfm-service-card::before {
  content: "🔧";
  font-size: 20px;
  flex-shrink: 0;
}

/* ============================================================
   TAGS SECTION
   ============================================================ */
.dfm-tags-section {
  margin: 32px 0;
  padding: 20px 0;
  border-top: 1px solid var(--dfm-gray-300);
}
.dfm-tags-section .dfm-tags-label {
  font-weight: 600;
  color: var(--dfm-gray-700);
  margin-bottom: 12px;
  font-size: 14px;
}
.dfm-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dfm-tag {
  display: inline-block;
  background: var(--dfm-gray-100);
  color: var(--dfm-gray-700);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--dfm-gray-300);
  transition: var(--dfm-transition);
}
.dfm-tag:hover {
  background: var(--dfm-primary);
  color: var(--dfm-white);
  border-color: var(--dfm-primary);
}

/* ============================================================
   GENERAL ENHANCEMENTS
   ============================================================ */

/* Better image rendering */
img {
  border-radius: var(--dfm-radius-sm);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better selection color */
::selection {
  background: var(--dfm-primary);
  color: var(--dfm-white);
}

/* Print styles for CTA */
@media print {
  .dfm-top-bar,
  .dfm-cta-banner,
  .dfm-rich-footer,
  .dfm-fixed-bottom-bar {
    display: none;
  }
}

/* ============================================================
   MOBILE-FIRST OVERRIDES
   Complete responsive redesign for phone screens
   ============================================================ */

/* --- Global Mobile Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img {
  max-width: 100%;
  height: auto;
}

/* --- Mobile Typography (≤767px) --- */
@media (max-width: 767px) {
  body, input, select, optgroup, textarea {
    font-size: 16px !important;
    line-height: 1.6 !important;
  }
  h1, .entry-title {
    font-size: 24px !important;
    line-height: 1.3 !important;
    word-break: break-word;
  }
  h2 {
    font-size: 20px !important;
    line-height: 1.4 !important;
  }
  h3 {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }
  h4, h5, h6 {
    font-size: 16px !important;
    line-height: 1.4 !important;
  }
  p {
    margin-bottom: 1em;
    line-height: 1.7 !important;
  }

  /* --- Prevent Horizontal Overflow --- */
  .site, #wrapper, .site-inner-wrap,
  .content-container, .site-container,
  .entry-content-wrap, .entry-content,
  .e-con, .e-con-inner, .elementor-widget-container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .e-con, .e-con-boxed, .e-con-inner {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .e-con.e-parent {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* --- Header Mobile Compact --- */
  .site-branding .site-title {
    font-size: 14px !important;
    line-height: 1.2 !important;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .site-branding a.brand img {
    max-width: 120px !important;
  }
  .site-main-header-inner-wrap {
    min-height: 56px !important;
    padding: 4px 0 !important;
  }
  .site-header-main-section-left {
    max-width: 65%;
  }

  /* --- Mobile Menu Button Larger Touch Target --- */
  .mobile-toggle-open-container .menu-toggle-open {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px !important;
    font-size: 24px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .mobile-toggle-open-container .menu-toggle-open .menu-toggle-icon {
    font-size: 24px !important;
  }

  /* --- Mobile Drawer Navigation --- */
  .mobile-navigation ul li {
    font-size: 16px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .mobile-navigation ul li a {
    padding: 14px 16px !important;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .mobile-navigation ul li.menu-item-has-children .drawer-nav-drop-wrap button {
    min-width: 48px !important;
    min-height: 48px !important;
  }

  /* --- Content Area Mobile --- */
  .content-area {
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
  }
  .entry-content-wrap {
    padding: 16px !important;
  }
  .content-container.site-container {
    padding: 0 !important;
  }

  /* --- Hero Section Mobile --- */
  .entry-hero .entry-hero-container-inner {
    padding: 20px 16px !important;
  }
  .entry-hero .entry-header {
    min-height: auto !important;
  }
  .page-hero-section .entry-header {
    min-height: 100px !important;
    padding: 16px !important;
  }

  /* --- Elementor Containers Mobile --- */
  .elementor-section, .elementor-container {
    max-width: 100% !important;
  }
  .elementor-column {
    width: 100% !important;
  }
  .elementor-column-wrap, .elementor-widget-wrap {
    padding: 0 !important;
  }

  /* --- Images Mobile --- */
  img {
    border-radius: 8px;
  }
  figure {
    margin: 0 0 1em 0 !important;
  }

  /* --- Tables Mobile --- */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    font-size: 14px;
  }

  /* --- Blockquote Mobile --- */
  blockquote {
    margin: 1em 0 !important;
    padding: 12px 16px !important;
    font-size: 16px !important;
  }

  /* --- Footer Mobile Spacing --- */
  .dfm-rich-footer {
    padding: 32px 0 100px !important;
  }
  .dfm-footer-inner {
    padding: 0 16px !important;
  }
  .dfm-rich-footer h4 {
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }
  .dfm-rich-footer ul li {
    margin-bottom: 10px;
  }
  .dfm-rich-footer ul li a {
    font-size: 15px;
    padding: 4px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .dfm-footer-bottom {
    margin-top: 24px;
    padding: 16px 16px 0;
    font-size: 12px;
  }
  .dfm-footer-bottom p {
    font-size: 12px;
  }

  /* --- FAQ Mobile --- */
  .dfm-faq-section {
    margin: 24px 0 16px !important;
    padding: 16px !important;
    border-radius: 8px;
  }
  .dfm-faq-section h2 {
    font-size: 20px !important;
    margin-bottom: 16px;
  }
  .dfm-faq-question {
    padding: 16px !important;
    font-size: 15px !important;
    min-height: 48px;
  }
  .dfm-faq-answer {
    padding: 0 16px 16px !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
  }

  /* --- CTA Banner Mobile --- */
  .dfm-cta-banner {
    margin: 24px 0 !important;
    border-radius: 8px;
  }
  .dfm-cta-inner {
    padding: 24px 16px !important;
  }
  .dfm-cta-inner h3 {
    font-size: 18px !important;
    line-height: 1.3;
  }
  .dfm-cta-inner p {
    font-size: 14px !important;
    margin-bottom: 16px;
  }
  .dfm-cta-btn {
    display: block !important;
    width: 100% !important;
    padding: 14px 20px !important;
    font-size: 17px !important;
    text-align: center;
    min-height: 48px;
  }
  .dfm-cta-btn-secondary {
    display: block !important;
    width: 100% !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    text-align: center;
    margin-left: 0 !important;
    margin-top: 10px !important;
    min-height: 48px;
  }

  /* --- Related Services Mobile --- */
  .dfm-related-services {
    margin: 24px 0 !important;
  }
  .dfm-related-services h3 {
    font-size: 18px !important;
  }
  .dfm-services-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .dfm-service-card {
    padding: 14px 16px !important;
    min-height: 48px;
    font-size: 15px !important;
  }

  /* --- Tags Mobile --- */
  .dfm-tags-section {
    margin: 20px 0 !important;
    padding: 16px 0 !important;
  }
  .dfm-tag {
    padding: 8px 14px !important;
    font-size: 13px !important;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* --- Top Bar Mobile --- */
  .dfm-top-bar {
    padding: 6px 0 !important;
    font-size: 12px !important;
  }
  .dfm-top-bar-inner {
    padding: 0 12px !important;
    flex-direction: row;
    justify-content: center !important;
    gap: 6px !important;
  }
  .dfm-top-bar a {
    padding: 4px 12px !important;
    font-size: 13px !important;
  }

  /* --- Body Bottom Padding for Fixed CTA Bar --- */
  body {
    padding-bottom: 72px !important;
  }

  /* --- Back to Top Button Mobile --- */
  .dfm-back-to-top {
    bottom: 80px !important;
    right: 12px !important;
    width: 40px !important;
    height: 40px !important;
  }
}

/* ============================================================
   FIXED BOTTOM CTA BAR (Mobile Only)
   ============================================================ */
.dfm-fixed-bottom-bar {
  display: none;
}
@media (max-width: 767px) {
  .dfm-fixed-bottom-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--dfm-white);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    padding: 8px 12px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    gap: 8px;
    align-items: center;
    justify-content: center;
  }
  .dfm-fixed-bottom-bar a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    border-radius: 10px;
    min-height: 48px;
    transition: var(--dfm-transition);
  }
  .dfm-fixed-bottom-bar .dfm-bottom-call {
    background: var(--dfm-primary);
    color: var(--dfm-white);
  }
  .dfm-fixed-bottom-bar .dfm-bottom-call:active {
    background: var(--dfm-primary-dark);
    transform: scale(0.97);
  }
  .dfm-fixed-bottom-bar .dfm-bottom-contact {
    background: var(--dfm-green);
    color: var(--dfm-white);
  }
  .dfm-fixed-bottom-bar .dfm-bottom-contact:active {
    background: #15803d;
    transform: scale(0.97);
  }
}

/* ============================================================
   TOUCH FEEDBACK (replace hover with active on mobile)
   ============================================================ */
@media (max-width: 767px) {
  .dfm-faq-question:active {
    background: var(--dfm-gray-100);
  }
  .dfm-service-card:active {
    border-color: var(--dfm-primary);
    background: #f0f7ff;
    transform: scale(0.98);
  }
  .dfm-tag:active {
    background: var(--dfm-primary);
    color: var(--dfm-white);
    border-color: var(--dfm-primary);
  }
  .dfm-rich-footer ul li a:active {
    color: var(--dfm-white);
    padding-left: 8px;
  }
  /* Disable hover effects on touch */
  .dfm-service-card:hover {
    transform: none;
  }
}

/* ============================================================
   FORM INPUT MOBILE (if forms exist)
   ============================================================ */
@media (max-width: 767px) {
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="url"], input[type="search"], input[type="number"],
  textarea, select {
    font-size: 16px !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    width: 100% !important;
    -webkit-appearance: none;
  }
  textarea {
    min-height: 100px !important;
  }
  button, input[type="submit"], input[type="button"],
  .wp-block-button__link, .elementor-button {
    min-height: 48px !important;
    font-size: 16px !important;
    padding: 12px 24px !important;
    width: 100%;
    border-radius: 10px !important;
  }
}

/* ============================================================
   TABLET TWEAKS (768-1024px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
  .dfm-services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .dfm-cta-btn, .dfm-cta-btn-secondary {
    display: inline-block !important;
  }
  body {
    padding-bottom: 0 !important;
  }
}
