@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

* {
  box-sizing: border-box;
}

.mini-cart {
    display: none!important;
}

body {
  background: #f0f4f8;
  font-family: 'Inter', sans-serif;
  align-items: center;
  margin: 0;
  min-height: 100vh;
}

h1 {
  padding: 0 20px;
}

.flex{
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.checkout-container{
    width: 650px;
}
.section#checkout-cart-summary {
    background-color: #fff;
    width: 400px;
    position: sticky;
    top: 65px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px;
}

#checkout-cart-summary h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #333;
  text-align: center;
}

#summaryContent {
  font-size: 16px;
  color: #444;
  margin-bottom: 20px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.total-line strong {
  font-size: 18px;
  color: #111;
}

h4.cart-item-name, .cart-item-quantity, .cart-item-price {
  font-size: 13px!important;
}

#checkout-button {
  margin-top: 20px;
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, rgba(93, 174, 43, 1) 0%, rgb(106, 212, 48) 90%, rgba(79, 161, 38, 0.9) 100%);
  background-size: 200% 200%;
  background-position: left center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  color: white;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.4s ease;
}

#checkout-button:hover {
  background-position: right center;
}

#button:hover {
  animation: moveGradient 1s ease forwards;
}

@keyframes moveGradient {
  0% {
    background-position: left center;
  }
  100% {
    background-position: right center;
  }
}

#checkout-button i {
  margin-right: 8px;
}

#checkout-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top: 2.5px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-background{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.spinner-background .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(82, 82, 82, 0.3);
  border-top: 3px solid rgb(0, 0, 0);
  animation: spin 1s linear infinite;
}

/* Masquer le spinner par défaut */
.hidden {
  display: none !important;
}

/* Animation de rotation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-container {
  background: white;
  padding: 10px 20px;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 100%;
}

h3 {
  margin-bottom: 1.5rem;
  color: #222;
}


form#delivery-form {
  display: flex;
  flex-direction: column;
}

.input-group {
  position: relative;
  margin-bottom: 15px;
}

.i-group{
  position: relative;
}

/* Icône à gauche */
.input-group .i-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  transition: color 0.3s ease;
  pointer-events: none;
}

/* Si erreur, change seulement la couleur, pas la position */
.input-group.has-error i {
  color: #ef4444;
}

/* Input style */
.double {
    display: flex;
    gap: 10px;
}
.double-city-postcode{
    display: grid;
    grid-template-columns: 2fr 1fr;
}
.double-fullname{
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.input-group input {
  width: 100%;
  padding: 15px 12px 15px 40px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid #ddd;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #fafafa;
  color: #5a5a5a;
}

/* Animation focus */
.input-group input:focus {
  border-color: #474747; /* bleu vif */
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
  top: -8px;
  left: 35px;
  font-size: 0.75rem;
  color: #333333;
  background: white;
  padding: 0 6px;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Labels en absolute pour animation */
.input-group label {
  position: absolute;
  left: 40px;
  top: 15px;
  color: #999;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
  transition: all 0.3s ease;
}

.input-group button {
  margin-top: 1rem;
  padding: 12px;
  background: #3b82f6;
  color: white;
  border: none;
  font-size: 1.1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.1s ease;
  user-select: none;
}

.input-group button:hover {
  background: #2563eb;
}

.input-group button:active {
  transform: scale(0.98);
}

/* Shipping form styling */
#shippingForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 1rem;
}

.shipping-method {
  width: 100%;
  padding: 3px 10px;
  border: 1.8px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  background-color: #fff;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  display: grid;
  align-items: center;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  user-select: none;
  box-shadow: 0 0px 5px rgba(0, 0, 0, 0.1);
}

.shipping-method img {
  width: 100px;
  height: auto;
  flex-shrink: 0;
}

.shipping-method div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

.shipping-method > :nth-child(2) {
  justify-content: flex-end;
}

.shipping-method div p {
  white-space: nowrap;
}

.shipping-method input[type="radio"] {
  accent-color: #3b82f6;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.shipping-method:hover {
  background-color: #e7e7e7;
  border-color: #5e5e5e;
}

.shipping-method input[type="radio"]:checked + label,
.shipping-method:has(input[type="radio"]:checked) {
  border-color: #5e5e5e;
  /* background-color: #e7e7e7; */
}

.input-group .facturation-checkbox{
  position: relative;
  left: 0;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 10px;
}

.input-group .facturation-checkbox input:not(:placeholder-shown) + label {
  position: relative;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  color: #333;
  
  pointer-events: all;
}

.input-group select {
  width: 100%;
  padding: 15px 12px 15px 40px; /* même padding que input */
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid #ddd;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #fafafa;
  color: #5a5a5a;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='10'%20height='7'%3E%3Cpath%20fill='%23999'%20d='M0,0%205,7%2010,0'%20/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
}

/* Flottement du label quand select a une valeur */
.input-group select:focus + label,
.input-group select:not([value=""]):valid + label {
  top: -8px;
  left: 35px;
  font-size: 0.75rem;
  color: #333333;
  background: white;
  padding: 0 6px;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Label par défaut */
.input-group select + label {
  position: absolute;
  left: 40px;
  top: 15px;
  color: #999;
  font-weight: 500;
  pointer-events: none;
  user-select: none;
  transition: all 0.3s ease;
}

/* Focus effet */
.input-group select:focus {
  border-color: #474747;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

/* Icône à gauche, réutilisée telle quelle */
.input-group .i-group i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

.client-address {
    background-color: #f6f6f6;
    border: 1px solid #ccc;
    padding: 15px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.6em;
    margin-bottom: 20px;
}

/* Modal styles */

.modal {
    display: none; /* caché par défaut */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

/* === Champs invalides === */
.input-group.has-error input {
  border-color: #e24343;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.2);
}

.input-group.has-error label {
  color: #e24343;
}

.input-group .input-error-message {
  display: none;
}

.input-group.has-error .input-error-message {
  display: block;
}

/* === Message d'erreur visible === */
.input-error-message {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 4px;
  font-weight: 500;
  display: none;
}

.input-group.has-error input {
  border: 2px solid #e74c3c !important;
  background-color: #fff5f5;
}

.input-error-message a.login-link {
  color: #e74c3c;
  text-decoration: underline;
  font-weight: bold;
  display: inline-block;
  margin-top: 4px;
}

.input-error-message a.login-link:hover {
  color: #c0392b;
}

#payment-message {
  color: #ef4444;
  font-size: 0.9rem;
  margin-top: 10px;
  width: 100%;
  text-align: center;
}

/* === Montre le message si parent a la classe "has-error" === */
.input-group.has-error .input-error-message {
  display: block;
}

.footer {
  background-color: #f8f8f8;
  border-top: 1px solid #ddd;
  padding: 100px 0;
  margin-top: 50px;
  font-family: Arial, sans-serif;
  color: #333;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  text-align: center;
  gap: 20px;
}

.footer-item {
  flex: 1 1 200px;
  min-width: 200px;
}

.footer-item i {
  font-size: 28px;
  color: #fb9902;
  margin-bottom: 15px;
}

.footer-item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color:#5f5f5f;
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.payment-methods label {
  border: 1px solid #ccc;
  background-color: #fff;
  padding: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s;
  min-width: 50px;
}

.payment-methods label img {
  max-width: 100%;
  height: auto;
  display: block;
}

.payment-methods label:hover {
  background-color: #ebebeb;
  transition: 0.3s;
}

.payment-methods label.selected {
  background-color: #dceefc; /* ou ta couleur de sélection */
  border-color: #00a0e8;
}

.payment-methods label input {
  display: none;
}

#paypal-button-container {
  margin-top: 20px;
}

label[for="form_ok_condition"] {
  padding: 5px;
  gap: 10px;
  font-size: 0.8rem;
  color: #333;
  text-align: justify;

}

/* Responsive */

@media (max-width: 1045px) {

  .flex {
    flex-direction: column;
    align-items: center;
  }

  .checkout-container {
    width: 80%;
  }

  .section#checkout-cart-summary {
    width: 80%;
  }

  .respno{
    display: none;
  }
  
}

@media (max-width: 575px) {
  .flex {
    padding: 5px;
  }
  .checkout-container{
    width: 100%;
  }
  .section#checkout-cart-summary {
    width: 100%;
  }

  .cli_header > :nth-child(1) {
    display: none;
  }

  .footer{
    margin-top: 0;
    padding: 50px 0;
  }


  #checkout-button, #paypal-button-container {
    position: sticky;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 50px;
  }

  .input-group input{
    font-size: 0.7rem;
  }
  .input-group label{
    font-size: 0.7rem;
    top: 17px;
  }

  .shipping-method div p {
    font-size: 11px;
  }
}

@media (max-width: 400px) {
  .form-container {
    padding: 1.5rem 2rem 2rem;
    width: 100%;
  }
}
