.phonescasely-purchase-panel {
  background: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
  border: 1px solid #e4e8f0;
  border-radius: 16px;
  color: #151b2d;
  margin-top: 1.35rem;
  overflow: hidden;
  padding: 1.15rem 1.2rem 1.2rem;
}

.single-product .woocommerce-product-details__short-description {
  line-height: 1.6;
  margin-bottom: 0 !important;
  position: relative;
  transition: max-height .28s ease;
}

/* Keep all catalogue-card titles compact and aligned. */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  line-clamp: 2;
  line-height: 1.35;
  min-height: 2.7em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Blocksy renders Related products with .product-title instead of the
 * standard WooCommerce loop-title class. Keep those cards aligned too. */
.single-product .related .product-title {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  line-clamp: 2;
  line-height: 1.35;
  min-height: 2.7em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Explicit Related-products selector: Blocksy may not wrap these titles in
 * WooCommerce's usual li.product element. */
.single-product .related .woocommerce-loop-product__title {
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  display: -webkit-box !important;
  line-clamp: 2 !important;
  line-height: 1.35 !important;
  max-height: 2.7em !important;
  min-height: 2.7em;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: normal !important;
}

/* Amazon-linked products are independent WooCommerce products. Keep Color as
 * pills, while Size becomes a compact native selector that links to the
 * matching product. */
.pcai-linked-options__group.phonescasely-size-select-group > div {
  display: block;
  width: 100%;
}

.pcai-linked-options .phonescasely-size-select {
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m3.25 5.75 4.75 4.75 4.75-4.75' stroke='%2317213a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.7'/%3E%3C/svg%3E");
  background-position: right 22px center;
  background-repeat: no-repeat;
  background-size: 16px;
  border: 1px solid #cfd8e6;
  border-radius: 10px;
  box-sizing: border-box;
  color: #17213a;
  cursor: pointer;
  font: inherit;
  font-size: .93rem;
  line-height: 1.2;
  min-height: 46px;
  padding: .55rem 3.6rem .55rem .8rem;
  width: min(100%, 360px);
}

.pcai-linked-options .phonescasely-size-select:focus {
  border-color: #2f6bff;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, .15);
  outline: 0;
}

/* Cart drawer and Cart-block product names: preserve the surrounding cart
 * controls while keeping long imported Amazon titles to two neat lines. */
#woo-cart-panel .product-title,
#offcanvas .product-title,
.ct-cart-content .product-title,
.woocommerce-mini-cart .product-title,
.wc-block-components-product-name,
.cfw-cart-item-title {
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  display: -webkit-box !important;
  line-clamp: 2 !important;
  line-height: 1.4 !important;
  max-height: 2.8em !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: normal !important;
}

/* Replace WooCommerce's tab switcher with two sequential product sections. */
.single-product .woocommerce-tabs > .wc-tabs,
.single-product .woocommerce-tabs > ul.tabs,
.single-product .wc-tabs-wrapper > .wc-tabs,
.single-product .wc-tabs-wrapper > ul.tabs {
  display: none !important;
}

.single-product .woocommerce-tabs .woocommerce-Tabs-panel,
.single-product .wc-tabs-wrapper .woocommerce-Tabs-panel {
  display: block !important;
  height: auto !important;
  margin: 0 !important;
  opacity: 1 !important;
  overflow: visible !important;
  padding: 0 !important;
  visibility: visible !important;
}

.single-product .woocommerce-tabs .woocommerce-Tabs-panel--description {
  padding-bottom: 2.75rem !important;
}

.single-product .woocommerce-tabs .woocommerce-Tabs-panel--reviews {
  border-top: 1px solid #e4e8ef;
  margin-top: .25rem !important;
  padding-top: 2.2rem !important;
}

.single-product .woocommerce-tabs .woocommerce-Reviews-title {
  color: #17213a;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 0 0 1.35rem;
}

/* Imported product names can be extremely long. Keep only the final
 * breadcrumb item compact without affecting the category trail. */
.single-product .ct-breadcrumbs .last-item {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.single-product .woocommerce-product-details__short-description.is-clamped {
  max-height: 8em;
  overflow: hidden;
}

.single-product .woocommerce-product-details__short-description.is-clamped::after {
  background: linear-gradient(to top, #ffffff 3%, rgba(255, 255, 255, .96) 35%, rgba(255, 255, 255, 0) 100%);
  bottom: 0;
  content: '';
  height: 3.6em;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.phonescasely-short-description-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  color: #273b66;
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
  font-size: .8rem;
  font-style: italic;
  font-weight: 600;
  margin: -.1rem 0 .85rem;
  padding: .15rem 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

.phonescasely-short-description-toggle:hover,
.phonescasely-short-description-toggle:focus-visible {
  color: #1c5de7;
  outline: none;
}

.single-product form.cart .phonescasely-buy-now-button {
  align-self: stretch;
  background: var(--theme-palette-color-1, #2563eb);
  border-color: var(--theme-palette-color-1, #2563eb);
  color: var(--theme-palette-color-8, #fff);
  flex: 0 0 100%;
  grid-column: 1 / -1;
  margin-top: .65rem;
  width: 100%;
}

.single-product form.cart .single_add_to_cart_button,
.single-product form.cart .phonescasely-buy-now-button {
  height: 55px;
  min-height: 55px;
}

.single-product form.cart .phonescasely-buy-now-button:hover,
.single-product form.cart .phonescasely-buy-now-button:focus-visible {
  background: var(--theme-palette-color-2, #1d4ed8);
  border-color: var(--theme-palette-color-2, #1d4ed8);
  color: var(--theme-palette-color-8, #fff);
}

.single-product form.cart .added_to_cart.wc-forward,
.single-product .woocommerce-notices-wrapper .wc-forward,
.single-product .woocommerce-message .wc-forward {
  display: none !important;
}

.phonescasely-delivery-estimate {
  align-items: center;
  background: linear-gradient(100deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid #dfe7f6;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(37, 77, 150, .07);
  display: flex;
  gap: .75rem;
  margin-bottom: 1rem;
  overflow: hidden;
  padding: .85rem .95rem;
  position: relative;
}

.phonescasely-delivery-estimate::after {
  background: linear-gradient(135deg, rgba(58, 112, 255, .10), rgba(58, 112, 255, 0));
  border-radius: 50%;
  content: '';
  height: 96px;
  pointer-events: none;
  position: absolute;
  right: -35px;
  top: -46px;
  width: 96px;
}

.phonescasely-delivery-estimate__icon {
  align-items: center;
  background: #edf3ff;
  border: 1px solid #d9e5ff;
  border-radius: 50%;
  color: #2360e6;
  display: inline-flex;
  flex: 0 0 38px;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.phonescasely-delivery-estimate__icon svg {
  height: 21px;
  width: 21px;
}

.phonescasely-delivery-estimate__content {
  display: grid;
  gap: .13rem;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.phonescasely-delivery-estimate__eyebrow {
  color: #587092;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.phonescasely-delivery-estimate strong {
  color: #18243d;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
  font-size: .82rem;
  line-height: 1.3;
}

.phonescasely-delivery-estimate time {
  background: #2463ed;
  border-radius: 999px;
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1;
  padding: .38rem .62rem;
  white-space: nowrap;
}

.phonescasely-delivery-estimate small {
  color: #61708a;
  font-size: .7rem;
  line-height: 1.25;
}

.phonescasely-purchase-panel__section + .phonescasely-purchase-panel__section {
  border-top: 1px solid #e7ebf3;
  margin-top: 1rem;
  padding-top: 1rem;
}

.phonescasely-purchase-panel__heading {
  align-items: center;
  display: flex;
  gap: .5rem;
  margin-bottom: .7rem;
}

.phonescasely-purchase-panel__heading svg {
  color: #20263a;
  flex: 0 0 24px;
  height: 24px;
  width: 24px;
}

.phonescasely-purchase-panel__heading h3 {
  color: inherit;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1.2;
  margin: 0;
}

.phonescasely-payment-methods {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: flex-start;
  max-width: 700px;
  width: 100%;
}

.phonescasely-payment-method {
  background-image: url('../images/phones-casely-payment-methods.png');
  background-repeat: no-repeat;
  background-size: 620px 86px;
  border-radius: 6px;
  display: block;
  flex: 0 0 56px;
  height: 42px;
  overflow: hidden;
  width: 56px;
}

.phonescasely-payment-method--visa { background-position: -8px -1px; }
.phonescasely-payment-method--jcb { background-position: -113px -1px; }
.phonescasely-payment-method--amex { background-position: -165px -1px; }
.phonescasely-payment-method--discover { background-position: -216px -1px; }
.phonescasely-payment-method--diners { background-position: -320px -1px; }

.phonescasely-delivery-methods,
.phonescasely-delivery-methods img {
  display: block;
  height: auto;
  max-width: 700px;
  width: 100%;
}

.phonescasely-purchase-benefits {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.phonescasely-purchase-benefits span {
  align-items: center;
  background: rgba(255, 255, 255, .82);
  border: 1px solid #e9edf4;
  border-radius: 9px;
  color: #3e4a60;
  display: flex;
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.3;
  min-height: 42px;
  padding: .45rem .6rem;
}

.phonescasely-purchase-benefits span::before {
  align-items: center;
  background: #e9f0ff;
  border-radius: 50%;
  color: #245ce8;
  content: '\2713';
  display: inline-flex;
  flex: 0 0 18px;
  font-size: .68rem;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  margin-right: .42rem;
}

.phonescasely-mobile-account-dock { display: none; }

@media (max-width: 767px) {
  .single-product .ct-breadcrumbs .last-item {
    max-width: 100px;
  }

  .single-product [data-vertical-spacing*="top"] {
    padding-top: 30px;
  }

  .single-product form.cart .quantity,
  .single-product form.cart .quantity .qty {
    height: 55px !important;
    min-height: 55px !important;
  }

  .single-product form.cart .quantity {
    align-self: stretch;
    box-sizing: border-box;
    --quantity-height: 55px;
  }

  .product > .woocommerce-tabs {
    clear: both;
    padding-top: 30px;
  }

  .phonescasely-purchase-panel {
    border-radius: 13px;
    padding: 1rem;
  }

  .phonescasely-delivery-estimate {
    align-items: flex-start;
    gap: .6rem;
    padding: .72rem;
  }

  .phonescasely-delivery-estimate__icon {
    border-radius: 9px;
    flex-basis: 34px;
    height: 34px;
    width: 34px;
  }

  .phonescasely-delivery-estimate strong {
    align-items: flex-start;
    flex-direction: column;
    gap: .28rem;
  }

  .phonescasely-purchase-benefits { grid-template-columns: 1fr; }

  .phonescasely-payment-methods {
    gap: .25rem;
    justify-content: flex-start;
  }

  .phonescasely-payment-method {
    background-size: 620px 86px;
    flex-basis: 56px;
    height: 42px;
    width: 56px;
  }

  .phonescasely-payment-method--visa { background-position: -8px -1px; }
  .phonescasely-payment-method--jcb { background-position: -113px -1px; }
  .phonescasely-payment-method--amex { background-position: -165px -1px; }
  .phonescasely-payment-method--discover { background-position: -216px -1px; }
  .phonescasely-payment-method--diners { background-position: -320px -1px; }

  .phonescasely-delivery-methods img {
    height: auto;
    max-width: 100%;
    width: 100%;
  }

  .phonescasely-delivery-methods {
    overflow: visible;
    padding-bottom: 0;
  }

  #offcanvas .ct-panel-content[data-device="mobile"] .ct-panel-content-inner {
    padding-bottom: 5.5rem;
  }

  #offcanvas .phonescasely-mobile-account-dock.is-ready {
    background: var(--theme-palette-color-8, #fff);
    bottom: 0;
    box-shadow: 0 -8px 20px rgba(20, 28, 47, .09);
    display: block;
    left: 0;
    padding: .85rem 1rem max(.85rem, env(safe-area-inset-bottom));
    position: sticky;
    right: 0;
    z-index: 12;
  }

  .phonescasely-mobile-account-dock__button {
    align-items: center;
    background: #111827;
    border-radius: 0;
    color: #fff !important;
    display: flex;
    font-size: .9rem;
    font-weight: 700;
    justify-content: center;
    letter-spacing: .03em;
    min-height: 48px;
    text-decoration: none;
    text-transform: uppercase;
    width: 100%;
  }
}
