:root{--kelmar-red:#b30000;--kelmar-red-dark:#7f0000;--kelmar-gray:#f6f6f6;}

/* Override template primary color */
.text-primary{color:var(--kelmar-red)!important;}
.bg-primary{background-color:var(--kelmar-red)!important;}
.btn-primary{background-color:#fff!important;border-color:var(--kelmar-red)!important;}
.btn-primary:hover,.btn-primary:focus{background-color:var(--kelmar-red-dark)!important;border-color:var(--kelmar-red-dark)!important;}

/* Header + nav */
.kelmar-top{position:relative;min-height:420px;color:#fff;background:#111;padding-top:52px;}
.kelmar-top .hero-bg{position:absolute;inset:0;background-size:cover;background-position:center 20%;filter:contrast(1.05) saturate(1.05);}
.kelmar-top .hero-overlay{position:absolute;inset:0;background:linear-gradient(90deg, rgba(179,0,0,.88) 0%, rgba(179,0,0,.70) 35%, rgba(0,0,0,.35) 100%);} 
.kelmar-top .hero-content{position:relative;z-index:2;padding:28px 0;}
.kelmar-logo{max-height:247px;width:auto;max-width:100%;height:auto;object-fit:contain;}
.kelmar-badge{max-width:130px;width:130px;height:130px;}

.kelmar-nav{background:var(--kelmar-red);}
.kelmar-nav .nav-link{color:#fff!important;font-weight:600;letter-spacing:.3px;padding:.95rem 1rem;}
.kelmar-nav .nav-link:hover{background:rgba(255,255,255,.12);}

.section-title{border-left:6px solid var(--kelmar-red);padding-left:12px;}
.kelmar-card{border:0;border-radius:14px;box-shadow:0 10px 24px rgba(0,0,0,.08);}
.kelmar-card .card-header{background:var(--kelmar-red);color:#fff;font-weight:700;border:0;}

/* WhatsApp floating */
.whatsapp-float{position:fixed;right:18px;bottom:18px;z-index:9999;display:flex;align-items:center;gap:10px;background:#25D366;color:#fff;padding:12px 14px;border-radius:999px;box-shadow:0 10px 24px rgba(0,0,0,.18);text-decoration:none;font-weight:700;}
.whatsapp-float:hover{color:#fff;filter:brightness(.95);text-decoration:none;}
.whatsapp-float svg{width:22px;height:22px;}

/* Gallery */
.gallery-img{border-radius:12px;object-fit:cover;width:100%;height:220px;}

/* Mobile tweaks */
@media (max-width: 991px){
  .kelmar-top{min-height:520px;}
  .kelmar-badge{width:110px;height:110px;}
}
@media (max-width: 575px){
  .kelmar-top{min-height:560px;}
  .kelmar-logo{max-height:156px;}
  .kelmar-badge{width:96px;height:96px;}
  .whatsapp-float{right:12px;bottom:12px;padding:10px 12px;}
  .whatsapp-float span{display:none;}
}

/* Remove template gold line on titles */
.section-title{padding-left:12px!important;}
.section-title::before{display:none!important;}

/* Machine cards */
.machine-img{width:100%;height:210px;object-fit:cover;border-radius:12px;}

.gallery-link{display:block;}
.gallery-link:hover .gallery-img{filter:brightness(.95);}

/* Fixed top info bar */
body{padding-top:0;}
.kelmar-info-bar{border-bottom:none;position:fixed;top:0;left:0;right:0;z-index:10050;background:var(--kelmar-red);color:#fff;font-size:14.5px;line-height:1.2;padding:12px 0;box-shadow:0 6px 16px rgba(0,0,0,.15);} 
.kelmar-info-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.kelmar-info-items,.kelmar-info-social{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.kelmar-info-item i,.kelmar-social-link i{margin-right:6px;}
.kelmar-social-link{color:#fff;text-decoration:none;font-weight:700;}
.kelmar-social-link:hover{text-decoration:underline;color:#fff;}
.kelmar-info-sep{opacity:.85;}

@media (max-width:575px){
  body{padding-top:0;}
  .kelmar-info-bar{border-bottom:none;font-size:14.5px;padding:12px 0;}
}

/* Reseña histórica justificada */
#empresa .card-body p{text-align:justify;}

@media (max-width:576px){.kelmar-logo{height:110px;}}

.kelmar-badge-inline{height:97px;width:auto;max-width:100%;margin-left:14px;object-fit:contain;align-self:flex-start;transform: rotate(20deg);transform-origin: left bottom;flex:0 0 auto;}
@media (max-width:576px){.kelmar-badge-inline{height:54px;margin-left:10px;}}

/* Back to top button (above WhatsApp) */
.to-top-float{
  position:fixed;
  right:18px;
  bottom:96px;
  width:43px;height:43px;
  border-radius:50%;
  background:var(--kelmar-red);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  z-index:1200;
  text-decoration:none;
}
.to-top-float svg{width:21px;height:21px;fill:#fff;}
.to-top-float:hover{filter:brightness(.95);}
@media (max-width:576px){
  .to-top-float{right:14px;bottom:88px;width:40px;height:40px;}
}

/* Header logo row responsive: allow wrapping */
.kelmar-top .hero-content .d-flex.align-items-center.mb-3{flex-wrap:wrap;gap:10px;}
@media (max-width:768px){.kelmar-badge-inline{margin-left:10px;transform: rotate(20deg);height:74px;}}
}

@media (max-width:992px){
  .kelmar-info-bar{padding:10px 0;}
}
@media (max-width:576px){
  .kelmar-info-bar{font-size:13.5px;padding:10px 0;}
}

/* Header: logo + sello aligned to top; sello to the right, slightly above, rotated */
.kelmar-top .hero-content .d-flex.align-items-center.mb-3{
  align-items:flex-start !important;
}
.kelmar-badge-inline{
  align-self:flex-start;
  margin-top:0;
  transform: rotate(20deg);
  transform-origin: left bottom;
}
@media (max-width:768px){
  .kelmar-badge-inline{
    margin-top:0;
    transform: rotate(0deg);
  }
}

/* Top info bar layout: left contact, right social */
.kelmar-info-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.kelmar-info-items{
  flex:1 1 420px;
  justify-content:flex-start;
  gap:10px;
}
.kelmar-info-social{
  flex:0 1 auto;
  justify-content:flex-end;
  gap:10px;
}
@media (max-width:768px){
  .kelmar-info-items,
  .kelmar-info-social{
    flex:1 1 100%;
    justify-content:flex-start;
  }
}

/* Force logo + sello always on the same row */
.kelmar-top .hero-content .d-flex.align-items-center.mb-3{
  flex-wrap:nowrap !important;
  align-items:center !important;
  gap:12px !important;
}
.kelmar-logo{
  flex:1 1 auto;
  min-width:0;
  max-width:calc(100% - 110px); /* leave room for sello */
}
.kelmar-badge-inline{
  flex:0 0 auto;
}

/* Desktop/tablet: logo + sello on same row */
.kelmar-top .hero-content .d-flex.align-items-center.mb-3{
  flex-wrap:nowrap !important;
  align-items:center !important;
  gap:12px !important;
}
.kelmar-logo{
  flex:1 1 auto;
  min-width:0;
  max-width:calc(100% - 130px);
}
.kelmar-badge-inline{flex:0 0 auto;}

/* Mobile: badge drops below logo */
@media (max-width:576px){
  .kelmar-top .hero-content .d-flex.align-items-center.mb-3{
    flex-wrap:wrap !important;
    align-items:flex-start !important;
  }
  .kelmar-logo{max-width:100%;}
  .kelmar-badge-inline{
    order:2;
    flex-basis:100%;
    margin-left:0;
    margin-top:8px;
    transform: rotate(0deg);
    height:82px;
  }
}

@media (max-width:768px){
  .kelmar-info-inner{justify-content:center !important;}
  .kelmar-info-items, .kelmar-info-social{justify-content:center !important;}
  .kelmar-info-items{flex-basis:100%;}
  .kelmar-info-social{flex-basis:100%;}
}
