/*
 * v2 "Added to your basket" modal (js/default/basket_modal_v2.js). Loaded
 * only for v2 visitors (templates/default/content.php). Self-contained: no
 * .dest-v2 variables, so it works on every page. Pink only on Checkout.
 */

html.ssbm-open {
   overflow: hidden;
}

.ssbm {
   position: fixed;
   inset: 0;
   z-index: 1100;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 16px;
   font-family: inherit;
}

.ssbm[hidden] {
   display: none;
}

.ssbm-backdrop {
   position: absolute;
   inset: 0;
   background: rgba(20, 24, 58, 0.45);
   opacity: 0;
   transition: opacity .2s ease;
}

.ssbm-dialog {
   position: relative;
   box-sizing: border-box;
   width: 100%;
   max-width: 460px;
   max-height: calc(100vh - 32px);
   overflow: auto;
   padding: 28px 24px 24px;
   border-radius: 20px;
   background: #fff;
   box-shadow: 0 24px 64px rgba(20, 24, 58, 0.24);
   color: #4A4F63;
   opacity: 0;
   transform: translateY(12px);
   transition: opacity .2s ease, transform .2s ease;
}

.ssbm.is-open .ssbm-backdrop,
.ssbm.is-open .ssbm-dialog {
   opacity: 1;
   transform: none;
}

.ssbm-dialog:focus {
   outline: none;
}

.ssbm-x {
   position: absolute;
   top: 14px;
   right: 14px;
   width: 36px;
   height: 36px;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 0;
   border: 0;
   border-radius: 50%;
   background: #F3F5F9;
   color: #5B6178;
   font-size: 15px;
   cursor: pointer;
}

.ssbm-x:hover {
   color: #14183A;
}

.ssbm-head {
   display: flex;
   align-items: center;
   gap: 16px;
   padding-right: 36px;
}

.ssbm-badge {
   position: relative;
   flex: 0 0 52px;
   width: 52px;
   height: 52px;
}

.ssbm-flag,
.ssbm-globe {
   width: 52px;
   height: 52px;
   border-radius: 50%;
   object-fit: cover;
   box-shadow: 0 4px 14px rgba(20, 24, 58, 0.16);
   background: #fff;
}

.ssbm-flag[hidden],
.ssbm-globe[hidden] {
   display: none;
}

.ssbm-globe {
   display: flex;
   align-items: center;
   justify-content: center;
   color: #5B6178;
   font-size: 22px;
}

.ssbm-check {
   position: absolute;
   right: -4px;
   bottom: -4px;
   width: 24px;
   height: 24px;
   display: flex;
   align-items: center;
   justify-content: center;
   border: 2px solid #fff;
   border-radius: 50%;
   background: #14183A;
   color: #fff;
   font-size: 11px;
}

.ssbm-text {
   min-width: 0;
}

.ssbm-title {
   margin: 0;
   font-size: 19px;
   font-weight: 700;
   line-height: 1.3;
   color: #14183A;
}

.ssbm-name {
   margin: 4px 0 0;
   font-size: 14px;
   line-height: 1.45;
   color: #5B6178;
   overflow-wrap: anywhere;
}

/* Upgrade offer */
.ssbm-up {
   display: flex;
   align-items: center;
   gap: 14px;
   margin-top: 22px;
   padding: 16px;
   border: 1px solid #E4E8F0;
   border-radius: 16px;
   background: #F7F8FB;
}

.ssbm-up[hidden] {
   display: none;
}

.ssbm-up-text {
   flex: 1 1 auto;
   min-width: 0;
}

.ssbm-up-title {
   margin: 0;
   font-size: 15px;
   font-weight: 700;
   line-height: 1.35;
   color: #14183A;
}

.ssbm-up-sub {
   margin: 4px 0 0;
   font-size: 13.5px;
   line-height: 1.45;
   color: #4A4F63;
}

.ssbm-up-btn {
   flex: 0 0 auto;
   height: 40px;
   padding: 0 18px;
   border: 1.5px solid #14183A;
   border-radius: 999px;
   background: #fff;
   font-family: inherit;
   font-size: 14px;
   font-weight: 600;
   color: #14183A;
   cursor: pointer;
   transition: background-color .15s ease, color .15s ease;
}

.ssbm-up-btn:hover:not([disabled]) {
   background: #14183A;
   color: #fff;
}

.ssbm-up-btn[disabled] {
   opacity: .6;
   cursor: default;
}

.ssbm-error {
   margin: 12px 0 0;
   font-size: 13.5px;
   line-height: 1.45;
   color: #B42318;
}

.ssbm-error[hidden] {
   display: none;
}

.ssbm-status {
   margin: 12px 0 0;
   font-size: 13.5px;
   line-height: 1.45;
   color: #4A4F63;
}

.ssbm-status[hidden] {
   display: none;
}

.ssbm-error:focus,
.ssbm-status:focus {
   outline: none;
}

/* Buttons */
.ssbm-actions {
   display: flex;
   gap: 10px;
   margin-top: 24px;
}

.ssbm-btn {
   flex: 1 1 0;
   display: inline-flex;
   align-items: center;
   justify-content: center;
   box-sizing: border-box;
   height: 48px;
   padding: 0 18px;
   border-radius: 999px;
   font-family: inherit;
   font-size: 15px;
   font-weight: 600;
   text-decoration: none;
   white-space: nowrap;
   cursor: pointer;
   transition: background-color .15s ease, border-color .15s ease;
}

.ssbm-btn-ghost {
   border: 1.5px solid #E4E8F0;
   background: #fff;
   color: #14183A;
}

.ssbm-btn-ghost:hover {
   border-color: #C9CFDB;
}

.ssbm-btn-primary {
   border: 0;
   background: #E8236E;
   color: #fff;
}

.ssbm-btn-primary:hover {
   background: #C2145A;
   color: #fff;
   text-decoration: none;
}

.ssbm-btn:focus-visible,
.ssbm-up-btn:focus-visible,
.ssbm-x:focus-visible {
   outline: 2px solid #14183A;
   outline-offset: 2px;
}

/* Phone: full-width bottom sheet */
@media (max-width: 639px) {
   .ssbm {
      align-items: flex-end;
      padding: 0;
   }

   .ssbm-dialog {
      max-width: none;
      max-height: 90vh;
      padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
      border-radius: 20px 20px 0 0;
      transform: translateY(100%);
   }

   .ssbm-up {
      flex-wrap: wrap;
   }

   .ssbm-up-btn {
      width: 100%;
   }

   .ssbm-actions {
      flex-direction: column-reverse;
   }

   .ssbm-btn {
      flex: 0 0 auto;
      width: 100%;
   }
}

@media (prefers-reduced-motion: reduce) {
   .ssbm-backdrop,
   .ssbm-dialog {
      transition: none;
   }
}
