/* =============================================
   CWAP BANNER
   Full-width app banner. Mobile: stacked and centred over the mobile
   background; desktop: text left, phone-framed video right.
   ============================================= */

.cwap-banner-container .cwap-banner-wrapper {
  max-width: none;
  padding: 0;
}

/* the next band starts right below, like the reference page */
main > .section.cwap-banner-container {
  margin-bottom: 0;
  padding: 0;
}

/* sizes below are the reference page's (cwapbanner on asianpaints.com) */
.cwap-banner {
  --cwap-text: #222;
  --cwap-fade: #fff5eb;
  --cwap-gradient: linear-gradient(91deg, #431a80 1.46%, #ee4137 51.38%, #feb940);
  color: var(--cwap-text);
}

.cwap-banner .cwap-banner-hero {
  position: relative;
  box-sizing: border-box;
  height: 640px;
  overflow: hidden;
  padding: 27px 0 0;
}

/* background image with a fade to cream on mobile */
.cwap-banner .cwap-banner-bg {
  position: absolute;
  inset: 0;
}

.cwap-banner .cwap-banner-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--cwap-fade) 85%);
}

.cwap-banner .cwap-banner-bg picture,
.cwap-banner .cwap-banner-bg img {
  display: block;
  width: 100%;
  height: 100%;
}

.cwap-banner .cwap-banner-bg img {
  object-fit: contain;
  object-position: 0 0;
}

.cwap-banner .cwap-banner-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* text column: as wide as its widest line (the store buttons on mobile) */
.cwap-banner .cwap-banner-content {
  display: flex;
  flex-direction: column;
}

/* title: every line carries its own gradient across the column */
.cwap-banner .cwap-banner-title {
  margin: 0 0 14px;
  font-size: 32px;
  font-weight: 800;
  line-height: 35.2px;
  text-align: center;
}

.cwap-banner .cwap-banner-title span {
  display: block;
  background: var(--cwap-gradient);
  background-clip: text;
  color: transparent;
}

/* the reference title ends in a non-breaking space, which sets the column width */
.cwap-banner .cwap-banner-title span:last-child::after {
  content: '\00a0';
}

.cwap-banner .cwap-banner-caption {
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 800;
  line-height: 35.2px;
  color: var(--cwap-text);
}

.cwap-banner .cwap-banner-download {
  display: none;
}

/* store buttons */
.cwap-banner .cwap-banner-stores {
  display: flex;
  column-gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cwap-banner .cwap-banner-qr {
  display: none;
}

.cwap-banner .cwap-banner-store-link {
  display: block;
  line-height: 0;
}

.cwap-banner .cwap-banner-store-link img {
  width: 102px;
  height: 30px;
}

.cwap-banner .cwap-banner-store-link:focus-visible {
  outline: 1px solid #000;
  outline-offset: 2px;
}

/* phone-framed video; without authored frame images the bezel is drawn in CSS */
.cwap-banner .cwap-banner-media {
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 177px;
  height: 354px;
  margin-top: 20px;
  border: 6px solid #111;
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 1px #555, 0 12px 30px rgb(0 0 0 / 18%);
}

.cwap-banner .cwap-banner-video {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: cover;
}

.cwap-banner .cwap-banner-video:focus-visible {
  outline: 1px solid #000;
}

/* =============================================
   DESKTOP
   ============================================= */
@media (width >= 992px) {
  .cwap-banner .cwap-banner-hero {
    padding: 42px 0 24px;
  }

  .cwap-banner .cwap-banner-bg::after {
    content: none;
  }

  .cwap-banner .cwap-banner-bg img {
    object-fit: cover;
    object-position: 50%;
  }

  /* row as tall as the phone (575px), centred like the reference */
  .cwap-banner .cwap-banner-inner {
    flex-direction: row;
    justify-content: center;
    gap: 15%;
    height: 575px;
  }

  .cwap-banner .cwap-banner-content {
    align-items: flex-start;
    max-width: 500px;
  }

  .cwap-banner .cwap-banner-title {
    font-size: 80px;
    line-height: 85px;
    letter-spacing: -3px;
    text-align: left;
  }

  .cwap-banner .cwap-banner-caption {
    margin: 15px 0 27px;
    font-size: 32px;
  }

  .cwap-banner .cwap-banner-download {
    display: block;
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 21.86px;
  }

  .cwap-banner .cwap-banner-stores {
    align-items: flex-end;
    column-gap: 20px;
    margin-top: 15px;
  }

  /* each store: its QR code above its 150 x 43 button */
  .cwap-banner .cwap-banner-store {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 16px;
  }

  .cwap-banner .cwap-banner-qr {
    display: block;
    box-sizing: border-box;
    width: 110px;
    height: 110px;
    padding: 10px;
    border: 1px solid #000;
    border-radius: 8px;
  }

  .cwap-banner .cwap-banner-qr img {
    display: block;
    width: 88px;
    height: 88px;
    background: #000;
  }

  .cwap-banner .cwap-banner-store-link img {
    width: 150px;
    height: 43px;
  }

  .cwap-banner .cwap-banner-media {
    width: 287px;
    height: 575px;
    margin-top: 0;
    border-width: 8px;
    border-radius: 44px;
  }

  .cwap-banner .cwap-banner-video {
    border-radius: 36px;
  }
}

/* smaller desktops: the reference page zooms out in these steps */
@media (width >= 992px) and (width < 1100px) {
  .cwap-banner .cwap-banner-hero {
    zoom: 0.7;
  }
}

@media (width >= 1100px) and (width < 1200px) {
  .cwap-banner .cwap-banner-hero {
    zoom: 1;
  }
}

@media (width >= 1200px) and (width < 1280px) {
  .cwap-banner .cwap-banner-hero {
    zoom: 1;
  }
}

@media (width >= 1280px) and (width < 1366px) {
  .cwap-banner .cwap-banner-hero {
    zoom: 1;
  }
}

@media (width >= 1366px) and (width < 1440px) {
  .cwap-banner .cwap-banner-hero {
    zoom: 1;
  }
}

/* authored phone frame (as on the reference page): the frame image is the media
   background and the video plays on top of it, inside the frame's screen area
   (video 158 x 338 at 10, 8 on mobile; 256 x 550 at 16, 12 on desktop) */
.cwap-banner .cwap-banner-media.has-frame {
  border: 0;
  border-radius: 20px;
  background: var(--cwap-frame-mobile) center / contain no-repeat;
  box-shadow: none;
}

.cwap-banner .cwap-banner-media.has-frame .cwap-banner-video {
  position: absolute;
  top: 2.26%;
  left: 5.65%;
  width: 89.27%;
  height: 95.48%;
  border-radius: 12.66% / 5.92%;
}

@media (width >= 992px) {
  .cwap-banner .cwap-banner-media.has-frame {
    background-image: var(--cwap-frame-desktop);
  }

  .cwap-banner .cwap-banner-media.has-frame .cwap-banner-video {
    top: 12px;
    left: 16px;
    width: 256.36px;
    height: 550.3px;
    border-radius: 33px;
  }
}

/* =============================================
   IMAGE SECTIONS (e.g. "Discover our new Color Picker Tool")
   The whole component is one authored image per layout, on the reference's
   full-width cream band. The crops below fit the authored images: they drop
   the empty cream above the mobile text (rows 0-418 of 1624, so the text
   starts at the top of the band like the reference) and the black strip
   at the bottom of both images.
   ============================================= */
.cwap-banner .cwap-banner-feature {
  background: var(--cwap-fade);
}

.cwap-banner .cwap-banner-feature picture {
  display: block;
  max-width: 430px;
  aspect-ratio: 722 / 1163;
  margin: 0 auto;
  overflow: hidden;
}

.cwap-banner .cwap-banner-feature img {
  display: block;
  width: 100%;
  height: auto;

  /* percentage margins follow the width: 418px of a 722px-wide image */
  margin-top: -57.9%;
}

@media (width >= 992px) {
  .cwap-banner .cwap-banner-feature picture {
    max-width: 1440px;
    aspect-ratio: 4320 / 1884;
  }

  .cwap-banner .cwap-banner-feature img {
    margin-top: 0;
  }
}
