/* =========================================================
   CHECKOUT.CSS — cleaner + user-friendly
   Breakpoints: Desktop-short, Desktop-tall, Laptop-short, Tablet-tall
   ========================================================= */

/* -------------------------
   BASE (applies everywhere)
   ------------------------- */
*{
  box-sizing: border-box;
}

body{
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding-left: 5vw;
  padding-right: 5vw;
}

h1{
  text-align: center;
  color: #333;
}

h2{
  color: #333;
  font-weight: bold;
  text-align: left;
  margin-bottom: 1vh;
}

label{
  color: #555;
}

.checkout-container{
  display: flex;
  justify-content: space-between;
}

.items-column{
  margin-left: 4vw;
  margin-right: 2vw;
}

.right-column{
  flex: 0 0 40%;
  margin-right: 4vw;
  min-width: 0; /* flexbox safety */
}

form{
  display: flex;
  flex-direction: column;
}

/* Inputs */
input[type="text"],
input[type="email"],
select{
  padding: 0.2vw 0.5vw;
  border: 0.1vw solid #ccc;
  border-radius: 0.3vw;
  width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus{
  outline: none;
  border-color: #0070ba;
  box-shadow: 0 0 0.1vw rgba(0,112,186,0.6);
}

/* Tables */
table, th, td{
  border: 0.1vw solid #ccc;
}

/* Item images */
.item-image-container{
  width: 100%;
  height: 6vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.item-image{
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
}

/* Item rows */
.item_image{
  width: 4vw;
  padding: 0.2vw;
}
.item_title{
  color: #000;
  padding: 0.2vw 0.5vw;
  text-decoration: none;
}
.item_price{
  text-align: center;
  padding: 0.2vw 0.5vw;
}

/* Address columns */
.address_heading{
  width: 12.5vw;
  padding-left: 0.5vw;
  font-weight: bold;
}
.address_input{
  width: 22.5vw;
  font-weight: bold;
  text-align: center;
}

/* Totals */
.total_amount{
  background-color: #89E289;
}

/* Links */
a{
  text-decoration: none;
  color: #000;
}
a:hover{
  text-decoration: underline;
  color: green;
}

/* Buttons: shared formatting (so they match on every screen) */
button[type="submit"],
button.checkout_return_to_basket{
  padding: 0.5vw;
  color: white;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 2vh;
}

/* Submit button colour */
button[type="submit"]{
  background-color: #0070ba;
}
button[type="submit"]:hover{
  background-color: #005b99;
}

/* Return-to-basket colour */
button.checkout_return_to_basket{
  background-color: darkslategray;
  transition: all linear 80ms;
  box-shadow: 0.6vh 0.6vh 0.4vh rgba(0,0,0,0.2);
}
button.checkout_return_to_basket:hover{
  background-color: rgb(38,63,63);
  box-shadow: 0.6vh 0.6vh 0.4vh rgba(0,0,0,0.4);
}

/* Shadow for submit button (class-based, keeps your existing behaviour) */
.submit-btn{
  transition: all linear 80ms;
  box-shadow: 0.6vh 0.6vh 0.4vh rgba(0,0,0,0.2);
}
.submit-btn:hover{
  box-shadow: 0.6vh 0.6vh 0.4vh rgba(0,0,0,0.4);
}

/* Out of stock */
.out_of_stock_items{
  margin-right: 2vw;
  text-align: center;
  color: red;
  font-weight: bold;
}

/* Summary tables */
.order_summary_table,
.email_address_table,
.shipping_address_table{
  width: 100%;
  text-align: left;
}
.order_summary_table{
  text-align: center;
  font-weight: bold;
}
.summary input{
  text-align: center;
  font-weight: bold;
}


/* =========================
   DESKTOP (SHORT)  (your Dell monitor)
   ========================= */
@media (min-width: 1701px) and (max-width: 2200px) and (min-aspect-ratio: 41/20){

  h1{ font-size: 2vw; margin-top: 3vh; }
  h2{ font-size: 1.4vw; }
  p{ font-size: 1vw; }
  label{ font-size: 1vw; }

  input[type="text"],
  input[type="email"],
  select{ font-size: 1vw; }

  /* Button sizing */
  button[type="submit"],
  button.checkout_return_to_basket{
    border-radius: 2vw;
    font-size: 1.5vw;
  }

  /* Keep your existing “big left button” width */
  button.checkout_return_to_basket{
    width: 41.7vw;
  }

  .item_title{ width: 31.8vw; font-size: 1vw; }
  .item_price{ width: 5.3vw; font-size: 1vw; }
  .out_of_stock_items{ width: 41.7vw; }
}


/* =========================
   DESKTOP (TALL)  (your MateView)
   ========================= */
@media (min-width: 1701px) and (max-width: 2200px) and (min-aspect-ratio: 1/1) and (max-aspect-ratio: 89/50){

  h1{ font-size: 2vw; margin-top: 3vh; }
  h2{ font-size: 1.4vw; }
  p{ font-size: 1vw; }
  label{ font-size: 1vw; }

  input[type="text"],
  input[type="email"],
  select{ font-size: 1vw; }

  button[type="submit"],
  button.checkout_return_to_basket{
    border-radius: 2vw;
    font-size: 1.5vw;
  }

  button.checkout_return_to_basket{
    width: 41.7vw;
  }

  .item_title{ width: 30.7vw; font-size: 1.1vw; }
  .item_price{ width: 5.4vw; font-size: 1vw; }
  .item_image{ width: 5vw; }
  .out_of_stock_items{ width: 41.7vw; }
}


/* =========================
   LAPTOP (SHORT)  (your HP laptop)
   ========================= */
@media (min-width: 1101px) and (max-width: 1700px) and (min-aspect-ratio: 41/20){

  h1{ font-size: 2.5vw; margin-top: 3vh; }
  h2{ font-size: 1.2vw; }
  p{ font-size: 1.1vw; }
  label{ font-size: 1.05vw; }

  input[type="text"],
  input[type="email"],
  select{ font-size: 1vw; }

  button[type="submit"],
  button.checkout_return_to_basket{
    border-radius: 2.2vw;
    font-size: 1.7vw;
    margin-bottom: 2vh;
  }
  
  .items-column{
  margin-top: -2vh;
}

.right-column{
  margin-top: -2vh;
}

  /* Keep same idea: big left button width */
  button.checkout_return_to_basket{
    width: 41.7vw;
  }

  .item_title{ width: 31vw; font-size: 1vw; }
  .item_price{ width: 6vw; font-size: 1.1vw; }
  .item_image{ width: 4vw; }
  .out_of_stock_items{ width: 41.7vw; }
}


/* =========================
   TABLET (TALL)  (includes iPad landscape)
   ========================= */
@media (max-width: 1100px) and (min-aspect-ratio: 1/1) and (max-aspect-ratio: 89/50){

  /* More readable spacing on tablet */
  body{
    padding-left: 4vw;
    padding-right: 4vw;
  }

  h1{ font-size: 3vw; margin-top: 2vh; }
  h2{ font-size: 1.8vw; }
  p{ font-size: 1.6vw; }
  label{ font-size: 1.1vw; }

  /* Inputs: finger-friendly */
  input[type="text"],
  input[type="email"],
  select{
    font-size: 1.2vw;
    height: 4.2vh;
  }

  /* Buttons: same formatting, bigger tap targets */
  button[type="submit"],
  button.checkout_return_to_basket{
    border-radius: 3vw;
    font-size: 2.2vw;
    height: 7vh;
  }

  button.checkout_return_to_basket{
    width: 44vw;
  }

  .item_title{ width: 29.4vw; font-size: 1.3vw; }
  .item_price{ width: 8vw; font-size: 1.5vw; }
  .item_image{ width: 5.5vw; }

  .out_of_stock_items{ width: 44vw; }
  
  /* Inputs: reduce vertical space on iPad */
.right-column input[type="text"],
.right-column input[type="email"],
.right-column select{
  font-size: 1.2vw;
  height: 3.4vh;        /* ↓ from 4.2vh */
  padding: 0 0.6vw;     /* vertical 0, keep horizontal */
}

/* Tighten table rows */
.right-column td{
  padding-top: 0.2vh;
  padding-bottom: 0.2vh;
}

/* Tighten section titles */
.right-column h2{
  margin-top: 1.2vh;
  margin-bottom: 0.4vh;
}

/* Buttons: keep tappable but shorter */
button[type="submit"],
button.checkout_return_to_basket{
  height: 5.8vh;        /* ↓ from 7vh */
  font-size: 2.0vw;
  border-radius: 3vw;
}

  .items-column{
  margin-top: -2vh;
}
  
}


/* =========================
   iPad / tablet portrait lock
   ========================= */

/* hidden by default */
.rotate-warning{
  display: none;
}

/* Show ONLY on tablets in portrait */
@media (max-width: 1100px) and (orientation: portrait){

  .rotate-warning{
    position: fixed;
    inset: 0;
    background-color: #385F5F;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
  }

  .rotate-warning-box{
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    padding: 2rem;
    border: 2px solid white;
    border-radius: 12px;
    background-color: #373636;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  }

  /* Hide the actual site */
  body > *:not(.rotate-warning){
    display: none !important;
  }
}
