html, body {
  height: 100%;   /* para que el % tenga referencia */
  margin: 0;
  padding: 0;
}

@font-face {
    font-family: 'Associate-Sans';
    src: url('../../css/fonts/Associate-Sans/AssociateSansRegular.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;  /* toda la pantalla */
}

.tienda-div {
    line-height: 1;
    margin: 0px;
    padding: 0px;
    font-family: "Gabarito", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
    width: 100%;
    background: #e0e7ff; /* Color sólido, suave y alegre */
    position: relative;
}

.tienda-div::before {
    content: "";
    position: fixed;
    top: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #2fa0d8 60%, transparent 100%);
    opacity: 0.18;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
}
.tienda-div::after {
    content: "";
    position: fixed;
    bottom: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, #1d4b76 60%, transparent 100%);
    opacity: 0.13;
    z-index: 0;
    pointer-events: none;
    border-radius: 50%;
}

.tienda-div > * {
    position: relative;
    z-index: 1; /* El contenido estará por encima del sombreado */
}

ul{
    width: 100%;
}

li{
    display: flex;
    justify-content: space-between;
    padding: 15px 0px;
}


span{
    font-size: 15px;
}

b{
    font-weight: 500;
}

h2{
    font-size:34px;
    margin-top: 25px;
    margin-bottom: 18px;
    color: #1d4b76;
    letter-spacing: 1px;
    font-weight: 800;
}

label{
    font-weight: 100;
    color: #2f5d89;
}

.main-div{
    padding: 45px 25px 25px 25px;
    display: flex;
    justify-content: center;
    gap: 60px;
    align-items: flex-start; 
}

.spacer-div{
    width: 100%;
    display: flex;
    position: relative;
    flex: 1;
    gap: 8px;
    align-items: center;
    user-select: none;
}

.cesta-izquierda{
    width: 700px;
    max-width: 98vw;
    height: auto;
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cesta-derecha{
    width: 350px;
    max-width: 98vw;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cesta-div-izquierda{
    flex: 1 1 auto;  /* Permite que el contenedor crezca y se reduzca */
    width: 100%; /* Máximo de 500px */
    background: #f8fafc;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(47, 93, 137, 0.10);
    padding: 30px 18px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    border: 2px dashed #2fa0d8;
}

.cesta-div-derecha{
    flex: 1 1;
    background: #f8fafc;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(47, 93, 137, 0.10);
    padding: 22px 16px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

h2 {
    font-size: 2.2em;
    margin-top: 10px;
    margin-bottom: 18px;
    color: #1d4b76;
    letter-spacing: 1px;
    font-weight: 800;
}

.info-cesta{
    gap: 10px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.subinfo-cesta{
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    background: #e0e7ff;
    border-radius: 12px;
    padding: 8px 14px;
    margin-bottom: 6px;
}

.subinfo-cesta h4, .subinfo-cesta h3 {
    margin: 0;
    color: #1d4b76;
    font-weight: 700;
}

.input-text{
    border-radius: 12px;
    padding: 8px 14px;
    margin-bottom: 6px;
    border: 2px solid #e0e7ff;
    font-size: 1em;
    color: #1d4b76;
    font-weight: 600;
    background: #f5faff;
    transition: border-color 0.3s, box-shadow 0.3s;
    &::placeholder {
        color: #a1a1aa;
    }
    &:focus {
        border-color: #2fa0d8;
        outline: none;
    }   
    
}

.btn-compra {
    background: #2fa0d8;
    color: #fff;
    padding: 16px 60px;
    font-size: 1.1em;
    border-radius: 22px;
    border: none;
    box-shadow: none;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-compra:hover {
    background: #1d4b76;
    color: #fff;
}

.btn-back{
    color: #2fa0d8;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    text-decoration: none;
    display: inline-block;
    padding: 5px 0 10px 0;
}

.btn-back:hover{

    color: #c7d1ef;
}

/*estilo css js carrito vacío*/

.icon-cesta-vacia{
    width: 75px;
}

.titulo-cesta-vacia{
    font-weight: 500;
    color: #2f5d89;
    font-size: 1.4em;
}

.info-cesta-vacia{
    color: #2f5d89;
    font-size: .87em;
    text-align: center;
}

.btn-cesta-vacia{
    background: #fcfcf8;
    color: #2f5d89;
    padding: 17px 30px;
    margin-right: 10px;
    text-align: center;
    font-weight: 500;
    transition: .6s;
    border-radius: 4px;
    border: .1pc solid #2f5d89;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
}

.btn-cesta-vacia:hover{
    background: #deded9;
}


/* CSS articulos cesta*/


.info-li{
    gap: 25px;
    display: flex;
    width: auto;
}

.img-li{
    max-height: 175px; /* Asegura que la imagen sea un elemento de bloque */
}

.detalles-li{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.info-detalles{
    gap: 10px;
    color: #1d4b76;
    max-width: 200px;
    display: flex;
    flex-direction: column;
}

.titulo-li{
    font-size: 1.15em;
    width: 100%;
}

.talla-li{
    font-size: .9em;
}

.count-li{
    max-width: 77.05px;
    background: #1d4b76;
    color: white;
    border-radius: 30px;
    padding: 7.5px 12.5px;
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
}

.btn-li{
    width: 15px;
    background: transparent;
    color: white;
    border: none;
    font-size: 25px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center; /* Centra horizontalmente */
    align-items: center;
    transition: .3s;
    user-select: none;
}

.deshabilitado{
    color: #666666;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-li:hover{
    color: #dadada;
}

.action-li{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 7.5px;
    align-items: start;
}

.subprecio-li{
    display: flex;
    gap: 10px;
}

.precio-li{
    font-size: 1.25em;
}

.btn-borrar{
    border: none;
    color: #4577a6;
    background: none;
    font-size: 16px;
    cursor: pointer;
    transition: .2s;
}

.btn-borrar:hover{
    color: #4d89c1;
}

.text-style {
    display: flex; /* Asegura que el label sea un flex container */
    align-items: center;
    justify-content: center;
    color: #2f5d89;
    font-size: 16px;
    font-weight: 500;
    gap: 12px;
    width: 100%;
    margin: 11px 0 0 0;
    position: relative;
    min-width: 0; /* Ayuda a que las líneas no desaparezcan en espacios pequeños */
}

.text-style::before,
.text-style::after {
    content: "";
    flex: 1 1 0%;
    height: .5px;
    background: #2f5d89;
    border-radius: 2px;
    display: block;
    min-width: 16px; /* Opcional: asegura que la línea siempre sea visible */
}

@media (max-width: 900px) {
    .main-div {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }
    .cesta-izquierda, .cesta-derecha {
        width: 100%;
        max-width: 500px;
    }
}

.toast {
  display: flex;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  background: linear-gradient(90deg, #1d4b76 70%, #2fa0d8 100%);
  color: #fff;
  padding: 18px 44px 18px 60px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(30, 60, 120, 0.22), 0 2px 8px rgba(47,160,216,0.13);
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: 0.7px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateX(120%);
  align-items: center;
  min-width: 220px;
  max-width: 90vw;
  gap: 16px;
  border-left: 8px solid #ffe066;
  background-clip: padding-box;
  transition: none; /* dejamos que animaciones hagan el trabajo */
}

.toast.show {
  animation: toast-pop 0.38s cubic-bezier(.68,-0.55,.27,1.55) forwards;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
}

.toast.hide {
  animation: toast-pop-out 0.32s cubic-bezier(.68,-0.55,.27,1.55) forwards;
  pointer-events: none;
  visibility: visible; /* que sea visible durante la animación */
  opacity: 1;          /* inicia opacidad visible */
}


@keyframes toast-pop {
  0% {
    opacity: 0;
    transform: translateX(120%) scale(0.95);
  }
  60% {
    opacity: 1;
    transform: translateX(-8px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-pop-out {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  60% {
    opacity: 0.7;
    transform: translateX(-8px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateX(120%) scale(0.95);
  }
}

.toast.error {
  background: linear-gradient(90deg, #f44336 70%, #ffb347 100%);
  border-left: 8px solid #ff6f61;
}

.toast.success {
  background: linear-gradient(90deg, #4caf50 70%, #a8e063 100%);
  border-left: 8px solid #ffe066;
}

.toast .toast-icon {
  margin-right: 12px;
  font-size: 1.4em;
  display: flex;
  align-items: center;
}

@media (max-width: 700px) {
  .toast {
    right: 8px;
    left: 8px;
    bottom: 14px;
    min-width: 0;
    padding: 14px 10px 14px 36px;
    font-size: 1em;
  }
}


/* Responsive para menú */
@media (max-width: 700px) {
    #nav-buttons {
        right: 8px;
        top: 8px;
        min-width: 100px;
        padding: 6px;
        max-height: 36px;
    }
    #nav-buttons.open {
        max-height: 140px;
    }
    #nav-buttons::before {
        font-size: 0.95em;
        margin-bottom: 4px;
    }
    .nav-button {
        padding: 8px 10px;
        font-size: 0.95em;
    }
}

/* Responsive: ocultar menú horizontal en móviles y mostrar con .open */
@media (max-width: 900px) {
    #menu_horizontal {
        display: none;               /* oculto por defecto en móvil */
        position: absolute;
        top: 56px;                   /* ajustar según header */
        right: 0;
        left: 0;
        background: #fff;
        flex-direction: column;
        gap: 0;
        padding: 8px 12px;
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
        z-index: 60;
    }

    #menu_horizontal.open {
        display: flex;               /* visible al abrir */
    }

    #menu_horizontal a {
        display: block;
        padding: 12px 14px;
        border-bottom: 1px solid rgba(0,0,0,0.04);
    }

    /* el botón del menú a la vista */
    #btn_menu_horizontal {
        display: inline-block;
    }
    .dropdownMenu{
        left: 0 !important;
        right: inherit;
        text-align: left;
    }
    
    #primera_franja nav#menu_horizontal a,
    .user-menu .dropdownButton,
    .user-menu .dropdownButton:visited {
        display: inline-block;
        padding: 8px 14px;
        color: #2563a6;
        background: none;
        border: 1px solid transparent;
        font-family: 'Associate-Sans', sans-serif;
        border-radius: 6px;
        font-weight: 500;
        font-size: 1em;
        text-decoration: none;
        line-height: 1;
        cursor: pointer;
        transition: color 0.1s , background-color 0.1s , border-color 0.1s ;
    }

    /* Hover: solo cambia color de la letra (y ligero fondo opcional muy sutil) */
    #primera_franja nav#menu_horizontal a:hover,
    .user-menu .dropdownButton:hover,
    #primera_franja nav#menu_horizontal a:focus,
    .user-menu .dropdownButton:focus {
        animation: hoverFlash 1s forwards;
    }

    /* Alineación y separación coherente con el menú */
    #primera_franja nav#menu_horizontal a,
    .user-menu .dropdownButton{
        margin: 0 6px;
    }
    
    @keyframes hoverFlash {
        0% {
            color: 2563a6;
            background-color: transparent;
            border-color: transparent;transition: color 0.1s , background-color 0.1s , border-color 0.1s ;
        }
        50% {
            color: #17406b;
            background-color: rgba(23,64,107,0.04);
            border-color: rgba(23,64,107,0.06);
            transition: color 0.1s , background-color 0.1s , border-color 0.1s ;
        }
        100% {
            color: 2563a6;
            background-color: transparent;
            border-color: transparent;
            transition: color 0.1s , background-color 0.1s , border-color 0.1s ;
        }

    }
}