
/* gallery */

:root{
    /* common border radius */
    --scg-border-rad: 0.7rem;
  
    /* available fabric colors */
    --fc-outline-light: hsl(0,0%, 70%);
    --fc-outline-dark: hsl(0,0%, 20%);
    --fc-sel-outline: #ddbb44;
    --atc-btn-hvr: hsl(46, 32%, 62%);
  }
  /* *{border: 1px solid red} */
  
  html{
    scrollbar-color:
      hsl( from var(--background) h s calc( l + 5 ) )
      hsl( from var(--background) h s calc( l - 5 ) );
  }
  
  body {
      margin: 0;
      padding: 0;
      background-color: var(--background);
      color: var(--text);
      font-family: sans-serif;
      text-align: center;
  }
  
  #gallery-header {
      background-color: var(--header_bg);
      color: var(--header_text);
      padding: 0.4rem;
      font-size: 1.3rem;
      font-weight: bold;
  }
  
  #gallery-description{
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
    background-color: var(--sub_hdr_bg);
    padding: 1rem;
    & div{
      width: fit-content;
      display: inline-block;
      max-width: 25rem;
      text-align: left;
      text-wrap: pretty;
    }
  }

#banner-wrap {
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
}

#gallery-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
  
  /* Gallery container */
  #cgg-designs-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: calc( 100% - 4rem);
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
  }
  
  /* T-shirt listing container */
  .clc-div {
    background-color: hsla( from var(--card_bg) h s l / 0.25 );
    padding: 4px;
  }
  
  .cgg-listing-cont {
    display: flex;
    flex-direction: column;
    gap: 1px;
    width: 100%;
    max-width: 400px;
    border: 1px solid hsla( from var(--card_bg) h s l / 0.4 );
    border-radius: var(--scg-border-rad);
    overflow: hidden;
    padding: 0;
    margin: 0 auto;
    & .clc-title{
      font-size: 1.1rem;
      margin: 0;
      padding: 0.4rem;
      font-weight: normal;
      border-top-left-radius: calc( var(--scg-border-rad) - 1px);
      border-top-right-radius: calc( var(--scg-border-rad) - 1px);
      background-color: var(--card_hdr_bg);
      color: var(--card_hdr_text);
    }
    & .designed-for{
      font-size: 0.9rem;
    }
  }

  .clc-price{
    font-size: 1.3rem;
  }
   
  .clc-description{
    flex-grow: 1;
    font-size: 0.9rem;
    text-align: left;
    padding: 4px 8px 16px 16px;
  }
  
  .clc-img-cont{
      position: relative;
      overflow: hidden;
      cursor: pointer;
      & img{
        width: 100%;
        aspect-ratio: 1.094;
      }
  }
  .clc-maximize{
      position: absolute;
      opacity: 0.8;
      bottom: 10px;
      right: 10px;
      width: 24px;
      height: 24px;
      background-color: transparent;
      background-size: cover;
      pointer-events: none;
      & svg{
        stroke: var(--text)
      }
  }
  
.atc-button {
    background-color: var(--atc_btn_bg);
    color: #222222;
    padding: 0.2rem 0.8rem;
    border-radius: 1rem;
    border: 1px solid #222222;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

@media (hover: hover) {
  .atc-button:hover {
      background-color: var(--atc-btn-hvr);
  }
}
  .clc-available {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 4px 4px 4px 16px;
    gap: 10px;
  }

  .fabric-button {
      flex: 0 1 auto;
      cursor: pointer;
      font-size: 0.7rem;
      padding: 4px 6px;
      min-width: fit-content;
      border-radius: 0.3rem;
  }
  
  .fs-selected{
    outline: 1px solid var(--button-bg);
  }
  
  /* footer` */

footer{
  margin: 2rem 0;
}
  
footer .logo{
    width: 140px;
    height: 13px;
    background: var(--logo-url);
    background-size: cover;
    aspect-ratio: 10.64;
    margin: 0 auto;
}

  .footer-links {
    text-align: center;
    padding: 4px 0;
    font-size: 0.9rem;
  }
  
  .footer-links a {
    color: var(--text);
    text-decoration: none;
  }
  
  .report-link {
    opacity: 0.5;
    font-size: 0.9em;
  }
  
  .report-link:hover {
    opacity: 1;
  }
  
  .separator {
    color: var(--text);
    opacity: 0.5;
  }
  
  /* image zoom on hover */
  
  /* Set up the transition for all images */
  [id^="clc-img-"] {
      transition: transform 3s ease;
    }
    
    /* Apply the zoom effect on hover */
    .cgg-listing-cont:hover [id^="clc-img-"] {
      transform: scale(2.05);
      transition: transform 3s ease;
    }
    
    /* Faster zoom-out when not hovering */
    .cgg-listing-cont [id^="clc-img-"] {
      transition: transform 0.5s ease;
    }


    /* Cart Widget */
.cart-widget {
    z-index: 9999;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: hsla(0, 0%, 60%, 0.5);
    padding: 0.6rem 0.5rem 0.4rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid hsla(0,0%,20%,0.8);
    transition: background-color 0.2s;
  }
  
  .cart-widget:hover {
    background-color: hsla(29, 80%, 50%, 0.5);
  }
  
  /* Cart Icon */
  .cart-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: var(--header_text);
    opacity: 0.9;
  }
  
  /* Cart Counter Badge */
  .cart-counter {
    position: absolute;
    top: -0.6rem;
    right: -0.5rem;
    background-color: #e53e3e;
    color: white;
    border-radius: 9999px;
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    min-width: 1rem;
    text-align: center;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s, transform 0.2s;
  }
  
  .cart-counter.has-items {
    opacity: 1;
    transform: scale(1);
  }
  
    /* maximized view  */
  
    .maximized-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: hsla( 0, 0%, 30%, 0.8);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 1000;
  }
  
  .maximized-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
      background: var(--bg);
      padding: 2px;
      border-radius: 8px;
      width: 98vw;
      max-height: 96vh;
      gap: 2px;
      & .close-button{
        z-index: 1000;
        text-align: right;
        font-size: 2rem;
        cursor: pointer;
      }
      & .max-title{
        font-size: 1.4rem;
      }
    }
    
    .maximized-image {
      z-index: 900;
      max-height: 70vh;
      object-fit: contain;
      cursor: pointer;
      scale: 1.5;
    }
    
    .max-controls {
      z-index: 1000;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 20px;
      & .bottom-controls{
        display:flex;
        justify-content: space-evenly;
        align-items: center;
        width: 70%;
      }
      & .max-price{
        font-size: 1.2rem;
        margin: 0.4rem;
        color: #eee;
        font-weight: bold;
      }
      & .atc-button{
        margin-top: 0.4rem;
      }
    }
  
  .max-zoom-label{
    font-size: 0.8rem;
  }
   .max-zoom{
    width: 50%;
    & input{
      width: 100%;
    }
  }
  
  /* browse */
  
  
  a {
    text-decoration: none;
    color: var(--header_text)
  }
  
  
  .gallery-preview{
    width: 90%;
    max-width: 1000px;
    margin-inline: auto;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid var(--gal-prev-outline);
    border-radius: 1rem;
      & .header{
        font-weight: 600;
        font-size: 1.2rem;
        padding: 0.4rem;
      }
      & .content-wrap{
        display: grid;
        grid-template-columns: 2fr repeat(4, 1fr);
        align-items: stretch;
        max-width: 100%;
        padding: 0.4rem;
        gap: 0.2rem;
      }
      & .description{
        font-size: 0.9rem;
        border-bottom-left-radius: 0.65rem;
        /* max-height: 200px; */
        text-align: left;
        padding: 0.4rem;
        /* margin-bottom: 0.23rem; */
      }
      & .visit{
        position: absolute;
        width: 6rem;
        height: 1.8rem;
        font-size: 1.2rem;
        right: 4rem;
        bottom: 0.6rem;
        color: #222;
        padding-top: 2px; 
      }
      & .visit:hover{
        opacity: 0.8;
      }
      & .thmb{
        overflow: hidden;
        aspect-ratio: 0.5;
      }
      & img{
        width: 100%;
        height: 100%;
        /* transform: scale(1.2); */
        object-fit: cover;
        object-position: center;
      }
  }
  
  /* Special layout for different design counts */
  .content-wrap-1 {
    display: grid;
    grid-template-columns: 2fr 4fr;
    align-items: stretch;
    max-width: 100%;
    padding: 0.4rem;
    gap: 0.2rem;
    & :nth-child(2) {
      border-bottom-right-radius: 0.65rem;
    }
  }
  
  .content-wrap-2 {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr;
    align-items: stretch;
    max-width: 100%;
    padding: 0.4rem;
    gap: 0.2rem;
    & :nth-child(3) {
      border-bottom-right-radius: 0.65rem;
    }
  }
  
  .content-wrap-3 {
    display: grid;
    grid-template-columns: 2fr 1.33fr 1.33fr 1.33fr;
    align-items: stretch;
    max-width: 100%;
    padding: 0.4rem;
    gap: 0.2rem;
    & :nth-child(4) {
      border-bottom-right-radius: 0.65rem;
    }
  }
  
  .content-wrap-4 {
    & :nth-child(5) {
      border-bottom-right-radius: 0.65rem;
    }
  }
  
  /* share buttons */
  
  .share-buttons {
    margin: 0.5rem 1rem;
    text-align: center;
  }
  
  .share-buttons h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }
  
  .share-links {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-bottom: 0.5rem;
  }
  
  .share-button:hover {
    transform: translateY(-2px);
  }
  
  .share-button img {
    width: 2rem;
    height: 2rem;
    opacity: 0.8;
  }
  
  .email-icon path{
    fill: white;
    stroke: black;
  }
  
  .design-share {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
  }
  
  .share-icon {
    background: hsl(0,0%,100%, 0.3);
    color: hsl(0,0%,0%,0.6);;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .share-icon:hover {
    background: hwb(0 100% 0% / 0.6);
  }
  
  .design-share-buttons {
    display: none;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: 44px;
    right: 0;
    background: rgba(255, 255, 255, 0.6);
    /* padding: 8px; */
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .design-share-buttons.active {
    display: flex;
  }
  
  .design-share-buttons .share-button {
    width: 32px;
    height: 32px;
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
  }

.email-button img{
  width: 26px !important;
  margin:auto;
}
  
  .design-share-buttons .share-button:hover {
    background-color: hsl(0,0%,100%,0.8);
  }
  
  .design-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
  }
  
  .design-header {
    text-align: center;
    margin-bottom: 30px;
  }
  
  .design-header h1 {
    margin: 0;
    font-size: 2.5em;
  }
  
  .gallery-link {
    margin-top: 10px;
    font-size: 1.1em;
  }
  
  .gallery-link a {
    color: var(--text);
    text-decoration: underline;
  }
  
  .design-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
  }
  
  .design-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
  }
  
  .design-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .design-description {
    font-size: 1.2em;
    line-height: 1.6;
  }
  
  .design-price {
    font-size: 2em;
    font-weight: bold;
  }
  
  .limited-series {
    padding: 15px;
    border: 2px solid var(--text);
    border-radius: 8px;
  }
  
  .sold-out {
    color: #ff0000;
    font-weight: bold;
    font-size: 1.2em;
  }
  
  .available-colors {
    margin-top: 20px;
  }
  
  .color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
  }
  
  @media (max-width: 700px) {
    .design-main {
        grid-template-columns: 1fr;
    }
    #gallery-description{
      flex-direction: column;
      align-items: center;
    }

    .atc-button{
      font-size: 1rem;
    }

    .clc-price{
      font-size: 1.5rem;
    }

    .cgg-listing-cont{
      & .designed-for{
        font-size: 0.9rem;
      }
    }
    .fabric-button {
          font-size: 0.9rem;
          line-height: 1.2rem;
          padding: 3px 6px 3px 6px;
          border-radius: 0.5rem;
      }

    .gallery-preview{
      & .content-wrap{
        grid-template-columns: repeat(4, 1fr);
      }
      & .description {
        grid-column: 1 / -1;
      }
      & .visit{
        position: relative;
        bottom: 0;
        right: 0;
        grid-column: 1 / -1;
        margin-inline: auto;
        margin-top: 0.4rem;
      }
      & :nth-child(2) {
        border-bottom-left-radius: 0.65rem;
      }
    }
    .max-colors{
      display: none;
    }
    .max-zoom{
      width:90%;
    }
    .bottom-controls{
      flex-direction: column;
    }
  
    /* gallery preview */
  
    .content-wrap-3 {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      grid-template-rows: auto auto auto;
    }
    .content-wrap-3 .description {
      grid-column: 1 / span 3;
      grid-row: 1;
    }
    .content-wrap-3 .thmb {
      aspect-ratio: 0.66 !important;
    }
    
    .content-wrap-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      grid-template-rows: auto auto auto;
    }
    .content-wrap-2 .description {
      grid-column: 1 / span 2;
      grid-row: 1;
    }
    .content-wrap-2 .thmb {
      aspect-ratio: 0.75 !important;
    }
    
    .content-wrap-1 {
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: auto auto auto;
    }
    .content-wrap-1 .description {
      grid-column: 1;
      grid-row: 1;
    }
    .content-wrap-1 .thmb {
      grid-column: 1;
      grid-row: 2;
      aspect-ratio: 1.5 !important;
    }
    
    .content-wrap {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: auto auto auto;
    }
    .content-wrap .description {
      grid-column: 1 / span 4;
      grid-row: 1;
    }
    
    /* Hide the visit button inside the content-wrap divs on mobile */
    .content-wrap .visit,
    .content-wrap-1 .visit,
    .content-wrap-2 .visit,
    .content-wrap-3 .visit {
      display: none;
    }
    
    /* Position the gallery-level visit button properly on mobile */
    .gallery-preview .visit {
      position: relative;
      margin-top: 0.8rem;
      display: block;
      color: #222222; /* Original text color */
      text-align: center;
    }
    
    /* Extra styles to ensure proper centering in mobile */
    .mobile-visit {
      width: 6rem;
      height: 1.8rem;
      font-size: 1.2rem;
      margin-top: 0.4rem;
      display: none;
      color: #222222;
    }
  }
  
  