/* ==========================================================================
   Storefront Layout, Toolbar & Search Styles (Apple Design System)
   ========================================================================== */

.storefrontPageContainer {
  position: relative;
  padding-bottom: 80px;
}

.storefrontPartnerHeroCard {
  margin-bottom: 20px;
}

/* ==========================================================================
   Integrated Partner Promo Benefit Section (in Partner Hero Card)
   ========================================================================== */
.ppV1PromoSection {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--apple-border);
}

.ppV1PromoToggle {
  display: none;
}

.ppV1PromoContent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--apple-content-bg);
  border: 0px solid var(--apple-border);
  border-radius: 12px;
  padding: 12px 16px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ppV1PromoLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ppV1PromoIcon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--sa-primary, #ea600e) 0%, #ff833e 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ppV1PromoText {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ppV1PromoText strong {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--apple-text, #1d1d1f);
}

.ppV1PromoText strong span {
  color: var(--sa-primary, #ea600e);
}

.ppV1PromoText span {
  font-size: 0.8125rem;
  color: var(--apple-text-secondary, #64748b);
  line-height: 1.35;
}

.ppV1PromoActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Active Code Box inside Hero Banner */
.storefrontActiveCodeBox {
  display: inline-flex;
  align-items: center;
  background: var(--sa-surface, #f8fafc);
  border: 1.5px dashed var(--sa-primary, #ea600e);
  border-radius: var(--apple-radius-sm, 10px);
  padding: 4px 6px 4px 12px;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.storefrontActiveCodeVal {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sa-text, #1d1d1f);
}

/* ==========================================================================
   Storefront Toolbar & Search
   ========================================================================== */
.storefrontToolbarLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.storefrontSearchDropdown {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 10px;
  padding: 4px 14px;
  cursor: text;
  text-align: left;
}

#storefront-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--sa-text, #1d1d1f);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  width: 360px;
  height: 28px;
  text-align: left;
}

#storefront-search-input::placeholder {
  color: var(--sa-text-secondary, #64748b);
  opacity: 0.7;
}

.storefrontClearBtn {
  background: transparent;
  border: none;
  color: var(--sa-text-secondary, #64748b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.storefrontClearBtn:hover {
  opacity: 1;
}

.dropdownMenu {
  max-height: 340px;
  overflow-y: auto;
}

/* ==========================================================================
   Bottom Sticky Floating Promo Bar
   ========================================================================== */
.storefrontStickyBar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(140%);
  z-index: 900;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 640px;
}

.storefrontStickyBar.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.storefrontStickyBar__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px 10px 24px;
  background: var(--sa-surface-raised, #ffffff);
  border: 1px solid var(--sa-border, #cbd5e1);
  border-radius: 9999px;
  box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.storefrontStickyBar__info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.storefrontStickyBar__text {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.storefrontStickyBar__hint {
  font-size: 14px;
  font-weight: 400;
  color: var(--sa-text, #1d1d1f);
  line-height: 1.35;
}

.storefrontStickyBar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#storefront-sticky-code-btn.has-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-radius: 300px;
}
  .storefrontStickyBar__actions .sa-btn {
    border-radius: 300px;
  }

/* ==========================================================================
   Dark Theme Overrides ([data-theme='dark'])
   ========================================================================== */
[data-theme='dark'] .ppV1PromoContent {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--apple-border);
}

[data-theme='dark'] .ppV1PromoText strong {
  color: #f1f5f9;
}

[data-theme='dark'] .ppV1PromoText span {
  color: #94a3b8;
}

[data-theme='dark'] .storefrontActiveCodeBox {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--sa-primary, #ea600e);
}

[data-theme='dark'] .storefrontActiveCodeVal {
  color: #f8fafc;
}

[data-theme='dark'] #storefront-search-input {
  color: #f1f5f9;
}

[data-theme='dark'] #storefront-search-input::placeholder {
  color: #94a3b8;
}

[data-theme='dark'] .storefrontStickyBar__container {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 35px -4px rgba(0, 0, 0, 0.55);
}

[data-theme='dark'] .storefrontStickyBar__hint {
  color: #f1f5f9;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 860px) {
  .storefrontPartnerHeroCard .ppMetaBadges,
  .storefrontPartnerHeroCard .ppV1PartnerDesc {
    display: none !important;
  }

  .storefrontPartnerHeroCard .ppV1HeroTop {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    grid-template-rows: auto auto !important;
    column-gap: 14px !important;
    row-gap: 6px !important;
    align-items: center !important;
  }

  .storefrontPartnerHeroCard .ppV1LogoWrap {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    align-self: center !important;
  }

  .storefrontPartnerHeroCard .ppV1HeroCenter {
    grid-column: 2 !important;
    grid-row: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .storefrontPartnerHeroCard .ppV1PartnerTitle {
    margin: 0 !important;
    line-height: 1.25 !important;
    font-size: 1.1875rem !important;
  }

  .storefrontPartnerHeroCard .ppV1HeroRight {
    grid-column: 2 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin-top: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
  }

  .storefrontPartnerHeroCard .ppRateBtn {
    padding: 4px 10px !important;
    font-size: 0.8125rem !important;
  }

  .ppV1PromoSection {
    margin-top: 14px;
    padding-top: 12px;
  }

  .ppV1PromoToggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--sa-primary, #ea600e);
    transition: color 0.2s ease;
  }

  .ppV1PromoToggle:hover {
    color: var(--apple-text, #1d1d1f);
  }

  .ppV1PromoToggle.is-open .ppV1MetaChevron {
    transform: rotate(180deg);
  }

  .ppV1PromoContent {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 12px;
    padding: 14px;
  }

  .ppV1PromoContent.is-open {
    display: flex;
  }

  .ppV1PromoActions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .ppV1PromoActions > button,
  .ppV1PromoActions .storefrontActiveCodeBox {
    width: 100%;
    justify-content: space-between;
  }

  /* Storefront Mobile Toolbar Customization */
  .storefrontPageContainer #region-select-container {
    padding-inline: 0 !important;
  }

  .storefrontToolbarLeft {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .storefrontToolbarLeft .regionDropdownWrapper {
    width: 100%;
  }

  .storefrontSearchDropdown {
    width: 100% !important;
    justify-content: flex-start !important;
    display: flex !important;
    box-sizing: border-box;
  }
  
  #storefront-search-input {
    width: 100% !important;
    flex: 1 !important;
    min-width: 0 !important;
    text-align: left !important;
  }

  .storefrontPageContainer .regionToolbarRight {
    width: 100% !important;
    margin-top: 2px !important;
  }

  .storefrontPageContainer .regionCountBadges {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .storefrontPageContainer .regionCountBadges .regionBadge {
    flex: 1 !important;
    width: 50% !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }
}

@media (max-width: 768px) {
  .storefrontStickyBar {
    bottom: 16px;
    width: calc(100% - 24px);
  }

  .storefrontStickyBar__container {
    padding: 8px 12px 8px 16px;
    gap: 12px;
  }

  .storefrontStickyBar__info {
    flex: 1;
    min-width: 0;
  }

  .storefrontStickyBar__text {
    flex: 1;
    min-width: 0;
  }

  .storefrontStickyBar__hint {
    font-size: 12px;
    line-height: 1.3;
  }
}

@media (max-width: 580px) {
  .storefrontStickyBar {
    bottom: 14px;
    width: calc(100% - 16px);
  }

  .storefrontStickyBar__container {
    padding: 6px 6px 6px 20px;
    gap: 8px;
  }

  .storefrontStickyBar__hint {
    font-size: 12px;
    line-height: 1.22;
    font-weight: 300;
  }

  .storefrontStickyBar__actions .sa-btn {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
    border-radius: 300px;
  }

  .storefrontActiveCodeBox {
    width: 100%;
    justify-content: space-between;
  }
}
