/*
Theme Name: Carpet Guardian
Theme URI: https://carpetguardian.co.uk/
Author: Carpet Guardian Ltd
Description: Lightweight custom WordPress theme converted from the existing Carpet Guardian static website.
Version: 11.0.0
Text Domain: carpet-guardian
*/

html { scroll-behavior: smooth; }
.wp-site-blocks { padding: 0; }
body { margin: 0; }
img { max-width: 100%; height: auto; }


/* Theme UI helpers */
.guardian-admin-note{background:#f0f7ff;padding:12px;border-left:4px solid #00A651}


/* Carpet Guardian responsive polish */
:root{--cg-navy:#0B1B3D;--cg-green:#00A651;--cg-border:#e2e8f0}
body{overflow-x:hidden}
.site-main{overflow:hidden}
.guardian-mobile-menu{background:rgba(255,255,255,.98);border-bottom:1px solid var(--cg-border);box-shadow:0 12px 24px rgba(11,27,61,.08)}
.guardian-mobile-menu nav a{display:block;padding:.8rem .75rem;border-radius:.8rem;color:#0B1B3D}
.guardian-mobile-menu nav a:hover{background:#f0fdf4;color:#008742}
.mobile-menu-toggle svg{pointer-events:none}

/* Better image treatment */
[data-purpose="hero-media-preview"]{min-height:320px}
[data-purpose="hero-media-preview"]>div:first-child{background-position:center 42%;}
[data-purpose="services-portfolio"] img{display:block;object-fit:cover;object-position:center}
[data-purpose="services-portfolio"] .group:hover img{transform:scale(1.035)}

/* Keep cards visually balanced when descriptions vary */
[data-purpose="services-portfolio"] .grid>div{min-width:0}
[data-purpose="services-portfolio"] h3{line-height:1.2}

/* Tables must scroll rather than break the page on phones */
[data-purpose="engineering-comparison"] .overflow-x-auto{-webkit-overflow-scrolling:touch}
[data-purpose="engineering-comparison"] table{min-width:640px}

/* Gallery: stacked before/after on very narrow screens */
@media (max-width:639px){
  [data-purpose="announcement-bar"]{font-size:11px}
  [data-purpose="announcement-bar"] .max-w-7xl>div:last-child{width:100%;justify-content:center;gap:.55rem;flex-wrap:wrap}
  [data-purpose="announcement-bar"] a{font-size:11px}
  [data-purpose="site-navigation"] .max-w-7xl{height:68px}
  [data-purpose="site-navigation"] .group .text-xl{font-size:17px}
  [data-purpose="site-navigation"] .group img{width:42px;height:42px}
  [data-purpose="site-navigation"]>div>div:last-child>a{padding:.65rem .75rem;font-size:11px}
  [data-purpose="hero-section"]{padding-top:1.25rem!important;padding-bottom:3rem!important}
  [data-purpose="hero-section"] h1{font-size:2.05rem;line-height:1.08}
  [data-purpose="hero-section"] .max-w-7xl{padding-left:1rem;padding-right:1rem}
  [data-purpose="hero-section"] .grid{gap:1.5rem}
  [data-purpose="hero-media-preview"]{min-height:245px;aspect-ratio:4/3}
  [data-purpose="hero-media-preview"] p.text-xl{font-size:1.1rem}
  [data-purpose="instant-price-estimator"]{padding:1rem!important;border-radius:1.35rem!important}
  [data-purpose="instant-price-estimator"] .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  [data-purpose="instant-price-estimator"] .guardian-estimate-total{font-size:2rem}
  [data-purpose="trust-badges"] .grid{gap:1rem}
  [data-purpose="trust-badges"] .flex.items-center{align-items:flex-start}
  [data-purpose="trust-badges"] .w-10{width:2.25rem;height:2.25rem}
  [data-purpose="services-portfolio"]{padding-top:3.5rem;padding-bottom:3.5rem}
  [data-purpose="services-portfolio"] .grid{gap:1rem}
  [data-purpose="services-portfolio"] .grid>div{border-radius:1.25rem}
  [data-purpose="services-portfolio"] .grid>div>div:first-child{height:12.5rem}
  [data-purpose="services-portfolio"] .grid>div>div:nth-child(2){padding:1.15rem}
  [data-purpose="services-portfolio"] h3{font-size:1.05rem}
  [data-purpose="engineering-comparison"] .grid{gap:1.5rem}
  [data-purpose="engineering-comparison"] .grid.grid-cols-3{grid-template-columns:1fr}
  [data-purpose="engineering-comparison"] .grid.grid-cols-3>div{display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:.75rem;text-align:left}
  [data-purpose="before-after-transformations"]{padding-top:3.5rem;padding-bottom:3.5rem}
  [data-purpose="before-after-transformations"] .grid{gap:1rem}
  [data-purpose="before-after-transformations"] .relative.h-64{height:auto;display:grid;grid-template-columns:1fr 1fr}
  [data-purpose="before-after-transformations"] .relative.h-64>div{height:12rem}
  [data-purpose="before-after-transformations"] .p-6{padding:1.15rem}
  [data-purpose="floating-whatsapp"]{right:.75rem;bottom:.75rem}
  [data-purpose="floating-whatsapp"]>a{padding:.7rem .85rem}
  footer .max-w-7xl{padding-left:1rem;padding-right:1rem}
}

@media (min-width:640px) and (max-width:1023px){
  [data-purpose="site-navigation"] .max-w-7xl{height:72px}
  [data-purpose="hero-section"] .grid{gap:2rem}
  [data-purpose="hero-media-preview"]{min-height:300px}
  [data-purpose="services-portfolio"] .grid>div>div:first-child{height:14rem}
}

/* Prevent long labels and URLs from forcing horizontal scroll */
[data-purpose="site-navigation"] a,[data-purpose="announcement-bar"] a,[data-purpose="instant-price-estimator"] *,footer *{overflow-wrap:anywhere}


/* Carpet Guardian v6 - explicit mobile layout overrides */
@media (max-width: 1023px){
  [data-purpose="site-navigation"] .mobile-menu-toggle{
    display:inline-flex !important;
    flex-shrink:0 !important;
  }
  [data-purpose="site-navigation"] > div > nav{
    display:none !important;
  }
  [data-purpose="site-navigation"] > div > div.hidden.lg\\:flex{
    display:none !important;
  }
  [data-purpose="site-navigation"] > div{
    min-height:68px !important;
    height:auto !important;
    padding-top:.75rem !important;
    padding-bottom:.75rem !important;
  }
  [data-purpose="site-navigation"] .mobile-menu-toggle{
    width:44px !important;
    height:44px !important;
    border:2px solid #e2e8f0 !important;
    border-radius:12px !important;
    background:#fff !important;
    color:#0B1B3D !important;
  }
  #guardian-mobile-menu[hidden]{display:none !important}
  #guardian-mobile-menu:not([hidden]){display:block !important}
}

@media (max-width:639px){
  [data-purpose="announcement-bar"] .max-w-7xl > div:first-child{
    width:100% !important;
    justify-content:center !important;
    text-align:center !important;
    flex-wrap:wrap !important;
  }
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child > span{
    display:none !important;
  }
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child{
    width:100% !important;
    justify-content:center !important;
  }
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child a{
    width:100% !important;
    justify-content:center !important;
  }
  [data-purpose="site-navigation"] .max-w-7xl{
    padding-left:1rem !important;
    padding-right:1rem !important;
  }
  [data-purpose="site-navigation"] .max-w-7xl > a .text-xl{
    font-size:16px !important;
  }
  [data-purpose="site-navigation"] .max-w-7xl > a img{
    width:40px !important;
    height:40px !important;
  }
  [data-purpose="hero-section"] .max-w-7xl{
    padding-left:1rem !important;
    padding-right:1rem !important;
  }
  [data-purpose="hero-section"] h1{
    font-size:2rem !important;
    line-height:1.08 !important;
  }
  [data-purpose="hero-section"] .mt-6.flex.flex-wrap{
    gap:.5rem !important;
  }
  [data-purpose="hero-section"] .mt-6.flex.flex-wrap > div{
    font-size:11px !important;
    padding:.5rem .7rem !important;
  }
  [data-purpose="services-portfolio"] .grid{
    grid-template-columns:1fr !important;
  }
  [data-purpose="instant-price-estimator"] .grid{
    grid-template-columns:1fr 1fr !important;
  }
  [data-purpose="before-after-transformations"] .grid{
    grid-template-columns:1fr !important;
  }
}


/* Carpet Guardian v7 - focused mobile polish */
@media (max-width:639px){
  /* Announcement bar: keep the three key messages cleanly stacked */
  [data-purpose="announcement-bar"] .max-w-7xl{
    gap:.35rem !important;
    padding-top:.15rem !important;
    padding-bottom:.15rem !important;
  }
  [data-purpose="announcement-bar"] .max-w-7xl > div:first-child,
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child{
    width:100% !important;
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    gap:.25rem !important;
  }
  [data-purpose="announcement-bar"] .max-w-7xl > div:first-child > span,
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child > span,
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child > a{
    width:100% !important;
    justify-content:center !important;
    text-align:center !important;
    margin:0 !important;
  }
  [data-purpose="announcement-bar"] .max-w-7xl > div:first-child > span:nth-child(2){display:none !important}
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child > span{display:inline-flex !important}
  [data-purpose="announcement-bar"] .max-w-7xl > div:last-child > a{display:inline-flex !important}

  /* Logo slogan: concise and visually attached to the brand name */
  [data-purpose="site-navigation"] .group .flex.flex-col{
    min-width:0 !important;
    align-items:flex-start !important;
  }
  [data-purpose="site-navigation"] .group .text-xl{
    font-size:16px !important;
    line-height:1 !important;
    white-space:nowrap !important;
  }
  [data-purpose="site-navigation"] .group .text-\[11px\]{
    font-size:8px !important;
    line-height:1.15 !important;
    letter-spacing:.08em !important;
    margin-top:.3rem !important;
    white-space:nowrap !important;
  }

  /* Scientific comparison: make horizontal scrolling obvious */
  [data-purpose="engineering-comparison"] .overflow-x-auto{
    position:relative !important;
    padding-bottom:.35rem !important;
    scrollbar-width:thin !important;
  }
  [data-purpose="engineering-comparison"] .mobile-table-hint{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:.35rem !important;
    margin:.25rem 0 .65rem !important;
    padding:.45rem .7rem !important;
    border-radius:999px !important;
    background:#eff6ff !important;
    color:#334155 !important;
    font-size:10px !important;
    font-weight:800 !important;
    text-align:center !important;
  }
  [data-purpose="engineering-comparison"] .overflow-x-auto::after{
    content:"Swipe →" !important;
    position:absolute !important;
    right:.45rem !important;
    bottom:.5rem !important;
    padding:.35rem .55rem !important;
    border-radius:999px !important;
    background:rgba(11,27,61,.92) !important;
    color:#fff !important;
    font-size:9px !important;
    font-weight:800 !important;
    pointer-events:none !important;
  }

  /* Copyright line: centered and clean on phones */
  footer .max-w-7xl.mt-12{
    align-items:center !important;
    text-align:center !important;
  }
  footer .max-w-7xl.mt-12 > p{
    width:100% !important;
    text-align:center !important;
    margin:0 !important;
  }
  footer .max-w-7xl.mt-12 > div{
    width:100% !important;
    justify-content:center !important;
    flex-wrap:wrap !important;
    row-gap:.5rem !important;
  }
}

@media (min-width:640px){
  [data-purpose="engineering-comparison"] .mobile-table-hint{display:none !important}
}

/* Carpet Guardian v10 - desktop brand slogan alignment */
@media (min-width:1024px){
  [data-purpose="site-navigation"] > .max-w-7xl > a.group .flex.flex-col{
    align-items:center !important;
    justify-content:center !important;
    text-align:center !important;
  }
}


/* Service postcode coverage checker */
#guardian-postcode-status{display:block}
#guardian-postcode-suggestions button{font-size:.75rem}
#guardian-booking-submit:disabled,#guardian-postcode-check:disabled{cursor:not-allowed}
#guardian-booking-form input:disabled,#guardian-booking-date:disabled,#guardian-booking-time:disabled{background:#f8fafc;opacity:.65;cursor:not-allowed}
