/******************************************
  FABRIC SWATCH GRID (500TC COLORS)
******************************************/

.swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    padding: 0;
}

.swatch-item {
    perspective: 900px;       /* Enables 3D space */
    display: inline-block;
    text-align: center;
    width: 120px;
    text-align: center;
    list-style: none;
}

.swatch-color-box {
    width: 120px;
    height: 120px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    transition:
        transform 0.45s cubic-bezier(.175,.885,.32,1.275),
        box-shadow 0.35s ease;
    cursor: pointer;
    will-change: transform;
}
.swatch-color-box:hover {
    transform:
        scale(1.30)
        rotateX(12deg)
        rotateY(-12deg)
        translateY(-20px);
    box-shadow: 0 35px 55px rgba(0,0,0,0.35);
    z-index: 15;
}


/* Label under swatch */
.swatch-item span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    display: block;
}

/* Hover effect optional */
.swatch-item:hover .swatch-color-box {
    transform: scale(1.15) translateY(-8px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}
.sw-width-label {
    position: absolute;
    top: 82%;
    left: 34%;
    transform: translate(-50%, -50%);
    height:30px;
   /* background: #fff;
    padding: 4px 12px;*/
    padding: 3px;
    font-size: 20px;
    font-weight: bold;
    color: #000;
    border: solid black 1px;
    border-radius: 5px;
}
.sw-length-label {
    position: absolute;
    top: 71%;
    right: 23%;
    transform: translate(50%, -50%);
    height:30px;
    /* background: #fff; 
    padding: 4px 12px;*/
    padding: 3px;
    font-size: 20px;
    font-weight: bold;
    color: #000;
    border: solid black 1px;
    border-radius: 5px;
}

.sw-height-label {
    position: absolute;
    top: 99%;
    left: 57%;
    transform: translate(-50%, -50%);
    height:30px;
   /* background: #fff;
    padding: 4px 12px;*/
    padding: 3px;
    font-size: 20px;
    font-weight: bold;
    color: #000;
    border: solid black 1px;
    border-radius: 5px;
}
.swatches-title {
    width: 100%;
    text-align: left !important;
    margin-left: 5%;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
}
.sw-custom-wrapper {
    display: flex;
    justify-content: center;     /* centers BOTH columns together */
    align-items: flex-start;
    gap: 60px;                   /* spacing between form + mattress */
    max-width: 1400px;           /* controls total width */
    margin: 0 auto;              /* center wrapper on page */
    padding: 20px 0;
}
/* === LEFT COLUMN WIDTH === */
.sw-left {
  flex: 1;
  max-width: 520px;
}
.sw-custom-box h2 {
  background: #fff;
  border: 1px solid #e5e5e5;
  padding: 25px;
  border-radius: 6px;
   border: none !important;
}
.sw-inner-box {
  padding: 15px;
  background: #f5f5f5;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  margin-top: 15px;
}
.sw-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}
.sw-input-row input,
.sw-field input,
.sw-field select {
  width: 100%;
  padding: 8px;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font-size: 15px;
}
.sheet-type label {
  font-size: 15px;
}

.sw-field {
  margin-bottom: 15px;
}

.sw-btn {
  width: 100%;
  padding: 12px;
  background: #0C3559;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.25s ease;
}

.sw-btn:hover {
  background: #092941;
}


/* === RIGHT COLUMN WIDTH === */
.sw-right {
    flex: 1;
    display: flex;
    justify-content: center;   /* centers mattress INSIDE right column */
}

/* === MATTRESS IMAGE BOX === */
.sw-mattress-wrapper {
    position: relative;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
}
.sw-mattress-img {
    width: 100%;
    display: block;
   /* border: 2px solid;
    border-color: black;*/
    margin-top: 100px;
}
/* === REMOVE INLINE STYLES FOR LABEL POSITIONING === */

.sw-dim {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 22px !important;
    font-weight: bold !important;
    color: #000 !important;
   /* box-shadow: none !important;*/
}

.sw-width-label {
    left: 20%;
    bottom: 9%;
    transform: translateX(-50%);
}

.sw-length-label {
    right: 18%;
    bottom: 22%;
    transform: translateX(50%);
}
/* HEIGHT VALUE */

.sw-height-label {
    left: 48%;
    bottom: -2%;
    transform: translateX(-50%);
}
.swatches-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 35px;
    padding: 10px 0 40px;
}

.swatches-grid div {
    text-align: center;
}
.swatches-grid img {
     transition: 
        transform 0.35s cubic-bezier(.25,.8,.25,1),
        box-shadow 0.35s ease,
        filter 0.35s ease;
    cursor: pointer;
}

.swatches-grid img:hover {
    transform: scale(1.22) rotate(1deg);
    filter: brightness(1.1) contrast(1.1);
    box-shadow: 0 10px 18px rgba(0,0,0,0.22);
    border-radius: 14px;
}
/* Label animation under swatches */
.swatch-label {
    margin-top: 10px;
    transition: transform 0.25s ease, color 0.25s ease;
}

.swatch-item:hover .swatch-label {
    transform: translateY(-5px);
    color: #0C3559;
}

@media (max-width: 600px) {

    .swatch-grid,
    .swatches-grid {
        gap: 15px !important;
        justify-content: center;
    }

    .swatch-item {
        width: 45% !important;         /* 2 per row on mobile */
        margin-bottom: 18px;
    }

    .swatch-color-box {
        width: 100% !important;
        height: 100px !important;      /* Better for phones */
    }

    .swatches-title {
        text-align: center !important;
        margin-left: 0 !important;
        font-size: 20px !important;
        margin-bottom: 18px;
    }

    /* Disable heavy hover effects for mobile (optional) */
    .swatch-color-box:hover {
        transform: scale(1.05) !important;
        box-shadow: 0 5px 10px rgba(0,0,0,0.25) !important;
    }


    /******************************************
      LEFT + RIGHT PANEL RESPONSIVE COLUMN FIX
    ******************************************/

    .sw-custom-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 10px 15px;
    }

    .sw-left {
        flex: 1 1 100%;
        width: 100% !important;
    }

    .sw-right {
        flex: 1 1 100%;
        width: 100% !important;
        justify-content: center;
    }


    /******************************************
      MATTRESS IMAGE & LABEL RESPONSIVENESS
    ******************************************/

    .sw-mattress-wrapper {
        max-width: 100% !important;
    }

    .sw-mattress-img {
        margin-top: 40px !important;
    }

    /* Dimension labels scaled & repositioned for phones */
    .sw-width-label,
    .sw-length-label,
    .sw-height-label {
        font-size: 14px !important;
        padding: 2px 6px !important;
        border-width: 1px !important;
    }

    .sw-width-label {
        left: 28% !important;
        bottom: 11% !important;
    }

    .sw-length-label {
        right: 18% !important;
        bottom: 28% !important;
    }

    .sw-height-label {
        left: 50% !important;
        bottom: -6% !important;
    }

}



/******************************************
   TABLET RESPONSIVE (600px – 992px)
******************************************/

@media (min-width: 600px) and (max-width: 992px) {

    .sw-custom-wrapper {
        flex-direction: column;
        gap: 40px;
    }

    .sw-left,
    .sw-right {
        width: 100% !important;
    }

    .swatch-item {
        width: 22% !important;          /* 4 per row on tablets */
    }

    .swatch-color-box {
        height: 120px !important;
    }

    .swatches-title {
        text-align: center !important;
        margin-left: 0 !important;
    }

    /* Mattress labels slightly reduced */
    .sw-width-label,
    .sw-length-label,
    .sw-height-label {
        font-size: 16px !important;
    }
}
@media (max-width: 600px) {

  .sw-custom-box {
    padding: 18px;
  }

  .sw-inner-box {
    padding: 12px;
  }

  .sw-input-row {
    flex-direction: column;   /* stack width/length/height */
    gap: 12px;
  }

  .sheet-type {
    gap: 10px;
  }

  .sw-btn {
    padding: 14px;
    font-size: 18px;
  }
}
/* MOBILE PORTRAIT — 320px to 480px */
@media (max-width: 480px) {

  .sheet-type {
    display: flex;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .sheet-type label {
    display: block !important;
    width: 100% !important;
    font-size: 16px !important;
    line-height: 1.4;
  }

  .sheet-type input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.1);   /* easier to tap on small screens */
  }
}
/* MOBILE PORTRAIT — COMPACT MATTRESS IMAGE */
@media (max-width: 480px) {

  /* Reduce mattress wrapper margins */
  .sw-mattress-wrapper {
    max-width: 260px !important;   /* reduces overall footprint */
    margin: 0 auto !important;
  }

  .sw-mattress-img {
    width: 100% !important;
    margin-top: 20px !important;   /* brings image closer to form */
  }

  /* Smaller & tighter dimension labels */
  .sw-width-label,
  .sw-length-label,
  .sw-height-label {
    font-size: 12px !important;
    padding: 2px 4px !important;
    border-width: 1px !important;
  }

  /* Reposition labels for compact image */
  .sw-width-label {
    left: 25% !important;
    bottom: 12% !important;
  }

  .sw-length-label {
    right: 20% !important;
    bottom: 26% !important;
  }

  .sw-height-label {
    bottom: -10% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }
}