/* Cello Product Conversion & Core Web Vitals Pack v1.0 */

/* Product page hierarchy and readable content. */
.product-detail ._titleh1 {
  line-height: 1.28;
  margin-bottom: 8px;
}
.product-detail .price-product {
  margin-top: 6px;
  margin-bottom: 12px;
}
.product-detail .price-product .price-new {
  line-height: 1.15;
}
.product-detail .action_buy {
  margin-top: 14px;
  margin-bottom: 10px;
}
.product-detail .action_buy .big-button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-description .content {
  line-height: 1.72;
}
.product-description .content p,
.product-description .content li {
  line-height: 1.72;
}
.product-description .content img {
  height: auto;
}

/* Reserve stable gallery space to reduce layout shift. */
.product-slider .slider-for {
  min-height: 420px;
}
.product-slider .slider-for .slider-item {
  min-height: 420px;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.product-slider .slider-for .slider-item img {
  width: auto;
  max-height: 420px;
  object-fit: contain;
}

/* Fixed mobile purchase control appears only after the main CTA leaves view. */
.mobile-product-buybar {
  display: none;
}

@media (max-width: 991px) {
  .product-slider .slider-for,
  .product-slider .slider-for .slider-item {
    min-height: 360px;
  }
  .product-slider .slider-for .slider-item img {
    max-height: 360px;
  }
}

@media (max-width: 767px) {
  body.mobile-product-buybar-visible {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .product-detail ._titleh1 {
    font-size: 23px;
    margin-top: 6px;
    margin-bottom: 6px;
  }
  .product-detail .box-sku-brand {
    margin-bottom: 8px;
  }
  .product-detail .price-product {
    margin: 4px 0 10px;
  }
  .product-detail .action_buy {
    margin-top: 10px;
    margin-bottom: 8px;
  }
  .product-description .content {
    font-size: 15px;
    line-height: 1.68;
  }
  .product-description .content h2 {
    font-size: 21px;
    line-height: 1.35;
    margin-top: 24px;
    margin-bottom: 10px;
  }
  .product-description .content h3 {
    font-size: 18px;
    margin-top: 20px;
  }
  .product-slider .slider-for,
  .product-slider .slider-for .slider-item {
    min-height: 300px;
  }
  .product-slider .slider-for .slider-item img {
    max-height: 300px;
  }
  .mobile-product-buybar {
    position: fixed;
    z-index: 1045;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 64px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97);
    border-top: 1px solid #e3e3e3;
    box-shadow: 0 -4px 16px rgba(0,0,0,.10);
    align-items: center;
    gap: 12px;
    transform: translateY(110%);
    transition: transform .22s ease;
  }
  .mobile-product-buybar.is-visible {
    display: flex;
    transform: translateY(0);
  }
  .mobile-product-buybar__price {
    flex: 1 1 auto;
    min-width: 0;
  }
  .mobile-product-buybar__price span {
    display: block;
    font-size: 11px;
    color: #777;
    line-height: 1.2;
  }
  .mobile-product-buybar__price strong {
    display: block;
    margin-top: 2px;
    font-size: 17px;
    line-height: 1.25;
    color: #df0000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-product-buybar__button {
    flex: 0 0 44%;
    min-height: 46px;
    border: 0;
    border-radius: 4px;
    background: #df0000;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
  }
  .mobile-product-buybar__button.is-disabled {
    opacity: .65;
  }
}

@media (max-width: 479px) {
  .product-slider .slider-for,
  .product-slider .slider-for .slider-item {
    min-height: 270px;
  }
  .product-slider .slider-for .slider-item img {
    max-height: 270px;
  }
}

/* v1.1 — keep floating contact CTAs clear of the mobile purchase bar. */
@media (max-width: 767px) {
  body.mobile-product-buybar-visible .f-block #btnMessengerChat {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  body.mobile-product-buybar-visible .f-block #btnZaloChat {
    bottom: calc(144px + env(safe-area-inset-bottom));
  }
  body.mobile-product-buybar-visible .f-block #btnPhoneCall {
    bottom: calc(204px + env(safe-area-inset-bottom));
  }

  /* Use Cello's orange brand color for price and purchase action. */
  .mobile-product-buybar__price strong {
    color: #ff6600;
  }
  .mobile-product-buybar__button {
    background: linear-gradient(180deg, #ff7a1a 0%, #ff5a00 100%);
    box-shadow: 0 2px 7px rgba(255, 90, 0, .28);
  }
  .mobile-product-buybar__button:focus,
  .mobile-product-buybar__button:hover,
  .mobile-product-buybar__button:active {
    background: linear-gradient(180deg, #ff6d0a 0%, #ed5200 100%);
    color: #fff;
  }
}


/* v1.2 — cleaner support information and delayed mobile purchase bar. */
.support .block-2 ul li {
  align-items: flex-start;
  line-height: 1.45;
}
.support .block-2 ul li > .fa {
  flex: 0 0 18px;
  width: 18px;
  margin-right: 8px;
  top: 2px;
  color: #00984a;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 767px) {
  .support .block-2 ul li {
    margin-bottom: 9px;
  }
}


/* CRO Stage 1 v1.0 — Buy Box, trust panel and desktop sticky CTA. */
.product-detail .product-buy-box {
  position: relative;
  padding: 18px 18px 16px;
  border: 1px solid #ececec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .055);
}
.product-buy-box__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  color: #287d3c;
  font-size: 12px;
  font-weight: 600;
}
.product-buy-box__status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 12px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.product-buy-box__status.is-in-stock {
  color: #25753a;
  background: #f0f8f2;
  border: 1px solid #d8ebdc;
}
.product-buy-box__status.is-out-of-stock {
  color: #a33b35;
  background: #fff3f2;
  border: 1px solid #f1d7d4;
}
.product-buy-box .gift-box-ajax,
.product-buy-box ._contentGift,
.product-buy-box .option-value {
  margin-top: 10px;
}
.product-buy-box .action_buy {
  margin-top: 14px;
  margin-bottom: 0;
}
.product-buy-box .action_buy .big-button {
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(255, 90, 0, .22);
}

.cello-trust-panel {
  overflow: hidden;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, .045);
}
.cello-trust-panel .block-1,
.cello-trust-panel .block-2,
.cello-trust-panel .block-3 {
  border-left: 0;
  border-right: 0;
}
.cello-trust-panel__contact h5,
.cello-trust-panel__livechat h5 {
  letter-spacing: .01em;
}
.cello-trust-panel__benefits ul {
  margin-bottom: 0;
}
.cello-trust-panel__benefits li {
  display: flex;
  min-height: 32px;
  padding: 6px 0;
  border-bottom: 1px dashed #ececec;
}
.cello-trust-panel__benefits li:last-child {
  border-bottom: 0;
}
.cello-trust-panel__benefits li > .fa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  margin-right: 9px;
  border-radius: 50%;
  background: #eef8f1;
  color: #218742;
  top: -1px;
  font-size: 12px;
}

.desktop-product-buybar {
  display: none;
}
@media (min-width: 992px) {
  body.desktop-product-buybar-visible {
    padding-bottom: 76px;
  }
  .desktop-product-buybar {
    position: fixed;
    z-index: 1038;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    padding: 8px 0;
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid #e2e2e2;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, .10);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform .24s ease, visibility .24s ease;
  }
  .desktop-product-buybar.is-visible {
    transform: translateY(0);
    visibility: visible;
  }
  .desktop-product-buybar__inner,
  .desktop-product-buybar__product,
  .desktop-product-buybar__action {
    display: flex;
    align-items: center;
  }
  .desktop-product-buybar__inner {
    justify-content: space-between;
    gap: 24px;
  }
  .desktop-product-buybar__product {
    min-width: 0;
    gap: 12px;
  }
  .desktop-product-buybar__product img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border: 1px solid #ededed;
    border-radius: 6px;
    background: #fff;
  }
  .desktop-product-buybar__summary {
    min-width: 0;
  }
  .desktop-product-buybar__summary strong {
    display: block;
    max-width: 520px;
    overflow: hidden;
    color: #222;
    font-size: 14px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .desktop-product-buybar__summary span {
    display: block;
    margin-top: 3px;
    color: #66806d;
    font-size: 11px;
  }
  .desktop-product-buybar__action {
    flex: 0 0 auto;
    gap: 18px;
  }
  .desktop-product-buybar__price span {
    display: block;
    color: #777;
    font-size: 11px;
    text-align: right;
  }
  .desktop-product-buybar__price strong {
    display: block;
    color: #ff6600;
    font-size: 20px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .desktop-product-buybar__button {
    min-width: 160px;
    height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 7px;
    background: linear-gradient(180deg, #ff7a1a 0%, #ff5a00 100%);
    box-shadow: 0 3px 10px rgba(255, 90, 0, .25);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
  }
  .desktop-product-buybar__button:hover,
  .desktop-product-buybar__button:focus {
    background: linear-gradient(180deg, #ff6d0a 0%, #ed5200 100%);
    color: #fff;
  }
  .desktop-product-buybar__button.is-disabled {
    opacity: .65;
  }
}

@media (max-width: 767px) {
  .product-detail .product-buy-box {
    padding: 14px 12px 12px;
    border-radius: 8px;
    box-shadow: 0 3px 13px rgba(0, 0, 0, .05);
  }
  .product-buy-box__eyebrow {
    margin-bottom: 7px;
  }
  .product-buy-box__status {
    margin: 6px 0 10px;
    padding: 7px 9px;
  }
}


/* Desktop guard: the consultation sheet belongs exclusively to Mobile CTA V2.
 * Its detailed styling intentionally lives inside the mobile breakpoint below.
 * Without this guard, the raw dialog HTML falls back into normal document flow
 * on desktop and appears unstyled above the footer. */
@media (min-width: 768px) {
  .cello-consult-sheet {
    display: none !important;
  }
}

/* ============================================================
   CELLO Product Mobile CTA V2.0 — Unified Sticky Action Bar
   One fixed layer only: Price | Consult | Buy. The global mobile
   contact footer is hidden on product pages and moved into a sheet.
   ============================================================ */
@media (max-width: 767px) {
  body.cello-product-unified-cta-active .cello-contact-float,
  body.cello-product-unified-cta-active .f-block {
    display: none !important;
  }

  body.cello-product-unified-cta-active .cello-footer__bottom .container {
    padding-bottom: 20px;
  }

  body.mobile-product-buybar-visible {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .mobile-product-buybar {
    display: grid !important;
    grid-template-columns: minmax(94px, 1fr) 78px minmax(124px, 1.18fr);
    align-items: center;
    gap: 8px;
    min-height: 68px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.985);
    border-top: 1px solid #e8e8e8;
    box-shadow: 0 -8px 24px rgba(17,17,17,.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(100% + 8px));
    transition: transform .24s cubic-bezier(.2,.75,.25,1), opacity .18s ease, visibility .24s ease;
  }

  .mobile-product-buybar.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .mobile-product-buybar__price {
    min-width: 0;
    padding-left: 2px;
  }
  .mobile-product-buybar__price span {
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .01em;
  }
  .mobile-product-buybar__price strong {
    margin-top: 2px;
    color: #111 !important;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -.02em;
  }

  .mobile-product-buybar__consult,
  .mobile-product-buybar__button {
    min-height: 46px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
  }

  .mobile-product-buybar__consult {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid #dedede;
    background: #fff;
    color: #222;
    line-height: 1.05;
  }
  .mobile-product-buybar__consult i { font-size: 16px; }
  .mobile-product-buybar__consult span { font-size: 10px; }
  .mobile-product-buybar__consult:active { transform: scale(.97); background: #f7f5f2; }

  .mobile-product-buybar__button {
    flex: none;
    width: 100%;
    border: 1px solid #111;
    background: #111 !important;
    box-shadow: none !important;
    color: #fff;
    letter-spacing: .015em;
  }
  .mobile-product-buybar__button:hover,
  .mobile-product-buybar__button:focus,
  .mobile-product-buybar__button:active {
    background: #000 !important;
    border-color: #000;
    color: #fff;
  }
  .mobile-product-buybar__button:active { transform: scale(.985); }
  .mobile-product-buybar__button.is-disabled { background: #b8b8b8 !important; border-color: #b8b8b8; }

  body.cello-consult-sheet-open { overflow: hidden; }

  .cello-consult-sheet {
    position: fixed;
    inset: 0;
    z-index: 1105;
    visibility: hidden;
    pointer-events: none;
  }
  .cello-consult-sheet.is-open {
    visibility: visible;
    pointer-events: auto;
  }
  .cello-consult-sheet__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(17,17,17,.32);
    opacity: 0;
    transition: opacity .22s ease;
  }
  .cello-consult-sheet.is-open .cello-consult-sheet__backdrop { opacity: 1; }

  .cello-consult-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: min(100%, 520px);
    max-height: min(82vh, 620px);
    margin: 0 auto;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -14px 38px rgba(0,0,0,.14);
    transform: translateY(105%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
  }
  .cello-consult-sheet.is-open .cello-consult-sheet__panel { transform: translateY(0); }

  .cello-consult-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }
  .cello-consult-sheet__eyebrow {
    display: block;
    margin-bottom: 4px;
    color: #9a8b7c;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
  }
  .cello-consult-sheet__header h3 {
    margin: 0;
    color: #111;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.02em;
  }
  .cello-consult-sheet__close {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e7e3de;
    border-radius: 50%;
    background: #f7f5f2;
    color: #333;
  }
  .cello-consult-sheet__intro {
    margin: 10px 0 15px;
    color: #707070;
    font-size: 12px;
    line-height: 1.55;
  }
  .cello-consult-sheet__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 9px;
  }
  .cello-consult-action {
    display: flex;
    min-width: 0;
    min-height: 66px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e7e3de;
    border-radius: 14px;
    background: #fff;
    color: #222;
    text-decoration: none !important;
  }
  .cello-consult-action.is-primary {
    grid-column: 1 / -1;
    background: #111;
    border-color: #111;
    color: #fff;
  }
  .cello-consult-action__icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f4efe8;
    color: #111;
    font-size: 16px;
  }
  .cello-consult-action.is-primary .cello-consult-action__icon {
    background: rgba(255,255,255,.14);
    color: #fff;
  }
  .cello-consult-action__icon.is-zalo {
    font-family: Arial,sans-serif;
    font-weight: 800;
  }
  .cello-consult-action strong,
  .cello-consult-action small { display: block; }
  .cello-consult-action strong { color: inherit; font-size: 13px; line-height: 1.2; }
  .cello-consult-action small { margin-top: 3px; color: #8a8a8a; font-size: 10px; line-height: 1.25; }
  .cello-consult-action.is-primary small { color: rgba(255,255,255,.66); }
  .cello-consult-sheet__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 14px;
    padding-top: 13px;
    border-top: 1px solid #eeeae5;
    color: #767676;
    font-size: 10.5px;
  }
}

@media (max-width: 359px) {
  .mobile-product-buybar {
    grid-template-columns: minmax(82px,1fr) 68px minmax(108px,1.08fr);
    gap: 6px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .mobile-product-buybar__price strong { font-size: 14px; }
  .mobile-product-buybar__button { font-size: 12px; }
  .mobile-product-buybar__consult { min-height: 44px; }
}

/* Desktop: use the normal Product Page buy box; no duplicate fixed CTA. */
@media (min-width: 992px) {
  .desktop-product-buybar { display: none !important; }
  body.desktop-product-buybar-visible { padding-bottom: 0 !important; }
}

/* Cello CTA Consistency v1.0 — all BUY NOW controls use the Design System primary token. */
.product-detail .action_buy .cello-buy-cta:not(.is-disabled),
.mobile-product-buybar__button.cello-buy-cta:not(.is-disabled),
.desktop-product-buybar__button.cello-buy-cta:not(.is-disabled) {
  border-color: var(--cello-color-primary, #f58220) !important;
  background: var(--cello-color-primary, #f58220) !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(245,130,32,.22) !important;
}
.product-detail .action_buy .cello-buy-cta:not(.is-disabled):hover,
.product-detail .action_buy .cello-buy-cta:not(.is-disabled):focus,
.mobile-product-buybar__button.cello-buy-cta:not(.is-disabled):hover,
.mobile-product-buybar__button.cello-buy-cta:not(.is-disabled):focus,
.desktop-product-buybar__button.cello-buy-cta:not(.is-disabled):hover,
.desktop-product-buybar__button.cello-buy-cta:not(.is-disabled):focus {
  border-color: var(--cello-color-primary-hover, #df6f0d) !important;
  background: var(--cello-color-primary-hover, #df6f0d) !important;
  background-image: none !important;
  color: #fff !important;
}
.product-detail .action_buy .cello-buy-cta.cello-buy-cta--danger {
  background: var(--cello-color-danger, #d93025) !important;
  border-color: var(--cello-color-danger, #d93025) !important;
  box-shadow: none !important;
}
.product-detail .action_buy .cello-buy-cta.cello-buy-cta--warning {
  background: var(--cello-color-warning, #f5a623) !important;
  border-color: var(--cello-color-warning, #f5a623) !important;
  box-shadow: none !important;
}
