/* MODERN_OVERHAUL_V1 */
/* "Additive" theme: does not depend on changing HTML structure */

:root{
  --bg:#0b0f14;
  --panel:#0f1620;
  --panel2:#121b26;
  --text:#e6edf6;
  --muted:#9aa7b7;
  --border:rgba(255,255,255,.10);
  --border2:rgba(255,255,255,.14);
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:16px;
  --radius2:14px;
  --accent:#3b82f6;
  --accent2:#2563eb;
  --success:#22c55e;
  --danger:#ef4444;
  --focus: 0 0 0 4px rgba(59,130,246,.22);
  --max:1200px;
}

/* Base */
html,body{background:var(--bg); color:var(--text);}
body{font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji"; line-height:1.55}
a{color:inherit}
.container{max-width:var(--max);}

/* Header */
.site-header{position:sticky; top:0; z-index:50; background:rgba(11,15,20,.75); backdrop-filter: none; border-bottom:1px solid var(--border);}
.header-inner{padding:14px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px;}
.logo a{font-weight:800; letter-spacing:.2px; text-decoration:none}
.main-nav a{opacity:.9; text-decoration:none; padding:10px 12px; border-radius:12px}
.main-nav a:hover{background:rgba(255,255,255,.06); opacity:1}
.account-menu a{border:1px solid var(--border); padding:10px 12px; border-radius:12px; text-decoration:none; background:rgba(255,255,255,.04)}
.account-menu a:hover{background:rgba(255,255,255,.07)}

/* Buttons */
.btn-primary, .btn, button, input[type="submit"]{
  border-radius:999px;
}
.btn-primary{
  background:linear-gradient(180deg, var(--accent) 0%, var(--accent2) 100%);
  border:1px solid rgba(255,255,255,.10);
  color:white;
  padding:10px 16px;
  box-shadow: 0 10px 22px rgba(37,99,235,.25);
}
.btn-primary:hover{filter:brightness(1.05)}
.btn-primary:focus{outline:none; box-shadow:var(--focus)}

/* Forms */
.search-section{padding:22px 0 8px}
.search-section .vehicle-search,
.search-section form{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}

select, input[type="text"], input[type="email"], input[type="tel"], textarea{
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:14px;
  padding:11px 12px;
}
select:focus, input:focus, textarea:focus{outline:none; box-shadow:var(--focus); border-color:rgba(59,130,246,.55)}
select:disabled{opacity:.55; cursor:not-allowed}

/* Vehicle cards grid — force consistent grid even if 1 result */
.site-main > .container{padding-bottom:40px}

/* Your pages are using inline grid styles; make them consistent */
.site-main .container > div[style*="grid-template-columns"]{
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  align-items:stretch !important;
}

/* Card base */
.site-main .container > div[style*="grid-template-columns"] > div[style*="border-radius"]{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)) !important;
  border:1px solid var(--border) !important;
  border-radius:var(--radius) !important;
  box-shadow:var(--shadow) !important;
  overflow:hidden !important;
  transform: translateZ(0);
}
.site-main .container > div[style*="grid-template-columns"] > div[style*="border-radius"]:hover{
  border-color:var(--border2) !important;
  transform: translateY(-2px);
}

/* Card image crop fix */
.site-main .container img[style*="height:220px"]{
  height: 200px !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* Card inner text */
.site-main .container div[style*="padding:1rem"]{
  color:var(--text) !important;
}
.site-main .container div[style*="text-transform:uppercase"]{
  color:var(--muted) !important;
}

/* "View" buttons on cards */
.site-main a[style*="border-radius:999px"][href*="/vehicle/"]{
  background:linear-gradient(180deg, var(--accent) 0%, var(--accent2) 100%) !important;
  color:white !important;
  border:1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 10px 22px rgba(37,99,235,.22) !important;
}

/* Footer */
.site-footer{
  border-top:1px solid var(--border);
  background:rgba(255,255,255,.02);
}
.footer-inner{padding:28px 20px}
.footer-column h4{margin:0 0 10px; letter-spacing:.2px}
.footer-column a{opacity:.9; text-decoration:none}
.footer-column a:hover{opacity:1; text-decoration:underline}

/* Cookie banner */
.cookie-banner{
  background:rgba(15,22,32,.95);
  border-top:1px solid var(--border);
}
.cookie-inner{max-width:var(--max); margin:0 auto; padding:14px 20px}

/* Responsive */
@media (max-width: 768px){
  .header-inner{padding:12px 14px}
  .search-section .vehicle-search, .search-section form{padding:14px}
}


/* Ensure the vehicle search UI is always clickable */
.search-section,
.search-section *{
  pointer-events: auto !important;
}

.search-section{
  position: relative !important;
  z-index: 20 !important;
}

/* If a blurred layer is accidentally applied to main content, neutralise it */
.site-main{
  filter: none !important;
}



/* Header: force crisp (no blur anywhere) */
.site-header{
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}

/* Vehicle detail mobile layout fixes */
@media (max-width: 768px){
  /* Title smaller, less vertical space */
  .vehicle-detail-page h1{
    font-size: 2rem !important;
    line-height: 1.12 !important;
    letter-spacing: -0.01em !important;
    margin-bottom: 0.6rem !important;
    overflow-wrap: anywhere !important;
  }

  /* Make panels/boxes align to same centered width */
  .vehicle-detail-page .vd-key-details,
  .vehicle-detail-page .key-details,
  .vehicle-detail-page .vd-details,
  .vehicle-detail-page .details-box,
  .vehicle-detail-page .vd-panel,
  .vehicle-detail-page .card,
  .vehicle-detail-page .box,
  .vehicle-detail-page .vd-description,
  .vehicle-detail-page .description,
  .vehicle-detail-page .specification,
  .vehicle-detail-page .specs,
  .vehicle-detail-page .enquire,
  .vehicle-detail-page .enquire-box,
  .vehicle-detail-page .enquire-about{
    width: 100% !important;
    max-width: 680px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Consistent side padding */
  .vehicle-detail-page .container{
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}


/* VEHICLE_DETAIL_MOBILE_TWEAKS_V2 */
/* Make the header crisp (fixes the blurry top area) */
.site-header{
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}

/* Vehicle detail: mobile layout tidy-up */
@media (max-width: 768px){

  /* Title smaller + uses width better */
  .vehicle-detail-page h1{
    font-size: clamp(1.7rem, 6vw, 2.2rem) !important;
    line-height: 1.12 !important;
    margin: 0 0 0.6rem 0 !important;
    letter-spacing: -0.01em !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
  }

  /* Make ALL main “boxes” align to the same width (matches key details box) */
  .vehicle-detail-page .container,
  .vehicle-detail-page .vd-key-details,
  .vehicle-detail-page .key-details,
  .vehicle-detail-page .vd-specs,
  .vehicle-detail-page .specification,
  .vehicle-detail-page .specifications,
  .vehicle-detail-page .vd-description,
  .vehicle-detail-page .description,
  .vehicle-detail-page .vd-enquire,
  .vehicle-detail-page .enquire,
  .vehicle-detail-page .enquire-box,
  .vehicle-detail-page .enquire-about,
  .vehicle-detail-page .card,
  .vehicle-detail-page .box,
  .vehicle-detail-page section{
    max-width: 680px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Keep consistent side padding so widths visually match */
  .vehicle-detail-page{
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}



/* Fix iOS/desktop header blur */
.site-header {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* Make it crisp/opaque so Safari doesn't blur content behind it */
  background: rgba(11,15,20,0.95) !important;
}

/* Vehicle detail mobile layout */
@media (max-width: 768px) {
  /* Title: smaller + uses width better (less stacking) */
  .vehicle-detail-page h1 {
    font-size: 2.05rem !important;
    line-height: 1.10 !important;
    letter-spacing: -0.01em !important;
    margin: 0.25rem 0 0.75rem 0 !important;
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    hyphens: auto !important;
  }

  /* Make the main content blocks all the same width */
  .vehicle-detail-page .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Target common "box/panel/card" containers on the vehicle detail page */
  .vehicle-detail-page .vd-key-details,
  .vehicle-detail-page .key-details,
  .vehicle-detail-page .vd-specs,
  .vehicle-detail-page .specs,
  .vehicle-detail-page .specification,
  .vehicle-detail-page .vd-description,
  .vehicle-detail-page .description,
  .vehicle-detail-page .vd-enquire,
  .vehicle-detail-page .enquire,
  .vehicle-detail-page .enquire-about,
  .vehicle-detail-page .vd-panel,
  .vehicle-detail-page .panel,
  .vehicle-detail-page .card,
  .vehicle-detail-page .box {
    width: 100% !important;
    max-width: 680px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  /* Prevent any "full bleed" sections from stretching wider than the boxes */
  .vehicle-detail-page > * {
    max-width: 100% !important;
  }
}


/* ADMIN_VEHICLE_EDIT_IMAGE_LAYOUT_FIX_V1 */
#vehicle-edit-form,
.admin-form{
  max-width: 1100px;
  margin: 0 auto;
}

#vehicle-edit-form img,
.admin-form img{
  max-width: 100%;
  height: auto;
  display: block;
}

#vehicle-edit-form .existing-images,
#vehicle-edit-form .image-grid,
#vehicle-edit-form .gallery-grid,
.admin-form .existing-images,
.admin-form .image-grid,
.admin-form .gallery-grid{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr)) !important;
  gap:16px !important;
  align-items:start !important;
}

#vehicle-edit-form .existing-images > *,
#vehicle-edit-form .image-grid > *,
#vehicle-edit-form .gallery-grid > *,
.admin-form .existing-images > *,
.admin-form .image-grid > *,
.admin-form .gallery-grid > *{
  background:#0b0f14;
  border:1px solid #222;
  border-radius:12px;
  padding:10px;
}

#vehicle-edit-form input[type="file"],
.admin-form input[type="file"]{
  width:100%;
}

#vehicle-edit-form .finance-fields,
.admin-form .finance-fields{
  margin-top:1rem;
}


/* MOBILE_VEHICLE_TITLE_FIX_V1 */
@media (max-width: 768px){

  /* main vehicle title */
  .vehicle-detail-page h1,
  .vehicle-title,
  .vd-title{

    font-size: 1.55rem !important;
    line-height: 1.2 !important;

    /* allow horizontal spreading */
    max-width: 100% !important;
    width: 100% !important;

    word-break: normal !important;
    overflow-wrap: break-word !important;

    margin-bottom: 6px !important;
  }

  /* reduce year size slightly */
  .vehicle-detail-page .year,
  .vehicle-year{
    font-size: 1.2rem !important;
  }

}


/* AVID_HOME_HERO_GAP_FINAL_FIX */

@media (max-width: 768px){

  .hero{
    height: 200px !important;
    min-height: 200px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .hero-overlay{
    height: 200px !important;
    min-height: 200px !important;
    padding: 10px 16px !important;
    display: flex !important;
    align-items: flex-end !important;
  }

  .hero-text{
    margin: 0 !important;
    padding: 0 !important;
  }

  .hero-text h1{
    margin: 0 0 6px 0 !important;
    font-size: 1.8rem !important;
    line-height: 1.1 !important;
  }

}



/* AVID_FINAL_MOBILE_CLEANUP_V1 */
@media (max-width: 768px){

  /* Header: keep crisp, no blur bleed */
  .site-header{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #17151c !important;
  }

  .header-inner{
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  /* Home hero: remove giant grey gap */
  .hero{
    height: 200px !important;
    min-height: 200px !important;
    margin: 0 !important;
    padding: 0 !important;
    background-position: center center !important;
    background-size: cover !important;
  }

  .hero-overlay{
    height: 200px !important;
    min-height: 200px !important;
    margin: 0 !important;
    padding: 0 16px 14px 16px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    background: linear-gradient(to bottom, rgba(0,0,0,.10), rgba(0,0,0,.24)) !important;
  }

  .hero-text{
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }

  .hero-text h1{
    margin: 0 0 6px 0 !important;
    font-size: 1.8rem !important;
    line-height: 1.08 !important;
  }

  .hero-text p{
    margin: 0 !important;
  }

  /* Vehicle detail: tighter top area */
  .vd-wrap{
    margin: 10px auto 28px !important;
    padding: 0 16px !important;
  }

  .vd-head{
    display: block !important;
    margin-bottom: 10px !important;
    gap: 10px !important;
  }

  .vd-title h1,
  h1.vehicle-mobile-title{
    margin: 0 0 8px 0 !important;
    font-size: 1.9rem !important;
    line-height: 1.08 !important;
    letter-spacing: -0.01em !important;
    max-width: 100% !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }

  .vd-year{
    margin: 0 0 10px 0 !important;
    font-size: 1rem !important;
  }

  .vd-gallery{
    margin-top: 10px !important;
  }

  .vd-below{
    margin-top: 14px !important;
  }
}


/* AVID_MOBILE_HEADER_AND_TITLE_FINAL_FIX */
@media (max-width: 768px){

  .site-header{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #17151c !important;
    position: relative !important;
    top: auto !important;
    z-index: 50 !important;
  }

  .header-inner{
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  /* vehicle page top spacing */
  .vd-wrap{
    margin-top: 28px !important;
  }

  .vd-head{
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .vd-title h1,
  h1.vehicle-mobile-title{
    margin-top: 0 !important;
  }
}


/* AVID_FINAL_MOBILE_TOP_FIX_V1 */
@media (max-width: 768px){

  /* Make the full header/nav block opaque and non-blurry */
  .site-header,
  .site-header .container,
  .site-header .header-inner,
  .site-header .main-nav,
  .site-header .main-nav a,
  .site-header .account-menu{
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    background: #17151c !important;
  }

  /* Remove any visual bleed under the header */
  .site-header{
    position: relative !important;
    top: auto !important;
    z-index: 50 !important;
    box-shadow: none !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
  }

  /* Vehicle page: push content down so title is not clipped */
  .vd-wrap{
    margin-top: 72px !important;
    padding-top: 0 !important;
  }

  .vd-head{
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .vd-title h1,
  h1.vehicle-mobile-title{
    margin-top: 0 !important;
  }
}


/* AVID_MOBILE_ACCOUNT_DROPDOWN_FIX_V1 */
@media (max-width: 768px) {
  .account-menu {
    position: relative !important;
  }

  .account-dropdown,
  .account-menu .dropdown-menu,
  .account-menu ul,
  .account-menu .menu-dropdown {
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    top: calc(100% + 8px) !important;
    width: min(280px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    box-sizing: border-box !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 9999 !important;
  }

  /* If any old rule tries centering with translate, kill it */
  .account-dropdown.open,
  .account-menu .dropdown-menu.open,
  .account-menu.open .account-dropdown {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
  }
}

