/* ==========================================================================
   BLOCK: STICKY BUTTON
   ========================================================================== */

.c-sticky-block {
  width: 0;
  height: 0;
  overflow: visible;
}

/* --------------------------------------------------------------------------
   SPACER (Espai de prevenció de solapament)
   -------------------------------------------------------------------------- */
.c-sticky-block__spacer {
  display: block;
  width: 100%;
  clear: both;
  pointer-events: none;
  height: var(--spc-d);
  background-color: var(--spc-c-d, transparent);
}

/* --------------------------------------------------------------------------
   STICKY WRAPPER I BOTÓ
   -------------------------------------------------------------------------- */
.c-sticky-block__wrapper {
  position: fixed;
  top: var(--pos-t-d);
  bottom: var(--pos-b-d);
  left: 0;
  width: 100%;
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.1s linear; 
}

body:not(.admin-bar) .c-sticky-block__wrapper {
  top: calc(var(--pos-t-d) - 32px);
}

.c-sticky-block__max-width {
  max-width: var(--max-w, 1440px);
  margin: 0 auto;
}

.c-sticky-block__grid {
  display: flex;
  justify-content: var(--align-x-d);
  pointer-events: none; 
}

.c-sticky-block__btn {
  pointer-events: auto; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--c-bg);
  color: var(--c-txt);
  border: 2px solid var(--c-bord);
  padding: var(--p-d);
  font-family: var(--ff-txt);
  font-size: var(--fs-txt-d);
  font-weight: var(--fw-txt);
  line-height: var(--lh-txt-d);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
}

.c-sticky-block__btn:hover {
  background-color: var(--c-bgh);
  color: var(--c-txth);
  border-color: var(--c-bordh);
  transform: translateY(-2px); 
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   VISIBILITAT RESPONSIVA
   ========================================================================== */
@media (min-width: 1025px) {
  .c-sticky-block.u-hide-desk { display: none !important; }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .c-sticky-block.u-hide-tab { display: none !important; }
}

@media (max-width: 768px) {
  .c-sticky-block.u-hide-mob { display: none !important; }
}

/* ==========================================================================
   RESPONSIVE SCALING I COMPENSACIONS
   ========================================================================== */

@media (min-width: 1441px) {
  .grid-container > .c-sticky-block__grid {
    grid-column-start: var(--col-start-xl, auto) !important;
    grid-column-end: span var(--col-span-xl, 12) !important;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .c-sticky-block__spacer {
    height: var(--spc-t);
    background-color: var(--spc-c-t, transparent);
  }

  .grid-container > .c-sticky-block__grid {
    grid-column-start: var(--col-start-t, auto) !important;
    grid-column-end: span var(--col-span-t, 12) !important;
  }
  
  .c-sticky-block__wrapper {
    top: var(--pos-t-t);
    bottom: var(--pos-b-t);
  }

  body:not(.admin-bar) .c-sticky-block__wrapper {
    top: calc(var(--pos-t-t) - 32px);
  }
  
  .c-sticky-block__grid {
    justify-content: var(--align-x-t);
  }
}

@media (max-width: 768px) {
  .c-sticky-block__spacer {
    height: var(--spc-m);
    background-color: var(--spc-c-m, transparent);
  }

  .grid-container > .c-sticky-block__grid {
    grid-column-start: var(--col-start-m, auto) !important;
    grid-column-end: span var(--col-span-m, 4) !important;
  }
  
  .c-sticky-block__wrapper {
    top: var(--pos-t-m);
    bottom: var(--pos-b-m);
  }

  body:not(.admin-bar) .c-sticky-block__wrapper {
    top: calc(var(--pos-t-m) - 46px);
  }
  
  .c-sticky-block__grid {
    justify-content: var(--align-x-m);
  }

  .c-sticky-block__btn {
    padding: var(--p-m);
    font-size: var(--fs-txt-m);
    line-height: var(--lh-txt-m);
  }
}