*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}

body{
    background:#f5f5f5;
}

/* Barra superior */

.barra-superior{
    background:#ff008c;
    color:white;
    text-align:center;
    padding:10px;
    font-weight:bold;
}

/* Header */

header{
    background:white;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:20px 50px;
    gap:25px;
}

.logo h1{
    color:#0099ff;
    font-size:42px;
    font-weight:bold;
}

.buscador{
    width:45%;
    display:flex;
}

.buscador input{
    width:100%;
    padding:12px;
    border:1px solid #ccc;
    border-radius:30px 0 0 30px;
    outline:none;
}

.buscador button{
    padding:12px 20px;
    border:none;
    background:#0099ff;
    color:white;
    border-radius:0 30px 30px 0;
    cursor:pointer;
}

.usuario{
    display:flex;
    align-items:center;
    gap:30px;
}

.usuario a{
    text-decoration:none;
    color:#333;
    font-weight:bold;
}

.carrito{
    position:relative;
    font-size:24px;
}

.carrito span{
    position:absolute;
    top:-10px;
    right:-12px;
    background:red;
    color:white;
    border-radius:50%;
    width:20px;
    height:20px;
    display:flex;
    justify-content:center;
    align-items:center;
    font-size:12px;
}

/* Menú */

nav{
    background:white;
    border-top:1px solid #ddd;
    border-bottom:1px solid #ddd;
}

nav ul{
    list-style:none;
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
}

nav ul li{
    margin:15px 25px;
    position:relative;
}

nav ul li a{
    text-decoration:none;
    color:#333;
    font-weight:bold;
}

nav ul li a:hover{
    color:#ff008c;
}

/* Submenú */

.submenu-medicamentos{
    display:none;
    position:absolute;
    top:100%;
    left:50%;
    transform:translateX(-50%);
    width:90vw;
    max-width:900px;
    background:#eaf5ff;
    padding:25px;
    border-radius:0 0 25px 25px;
    box-shadow:0 5px 15px rgba(0,0,0,.15);
    z-index:999;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
}

.submenu-medicamentos div{
    color:#003366;
    font-size:15px;
    cursor:pointer;
    transition:.3s;
}

.submenu-medicamentos div:hover{
    color:#0099ff;
    transform:translateX(5px);
}

.menu-medicamentos:hover .submenu-medicamentos{
    display:grid;
}

/* Banner */

.banner{
    height:450px;
    background:linear-gradient(to right,#64e5c7,#6de3d8);
    display:flex;
    align-items:center;
    padding-left:100px;
}

.texto-banner h2{
    color:#ff008c;
    font-size:60px;
    margin-bottom:20px;
}

.texto-banner p{
    font-size:25px;
    margin-bottom:20px;
}

.texto-banner button{
    background:#ff008c;
    color:white;
    border:none;
    padding:15px 35px;
    border-radius:30px;
    cursor:pointer;
    font-size:18px;
}

.texto-banner button:hover{
    background:#e6007e;
}

/* Categorías */

.categorias{
    padding:50px;
    background:white;
}

.categorias h2{
    margin-bottom:30px;
    color:#333;
    border-bottom:1px solid #ddd;
    padding-bottom:15px;
}

.contenedor-categorias{
    display:flex;
    justify-content:center;
    gap:20px;
    flex-wrap:wrap;
}

.categoria{
    width:190px;
    height:75px;
    border-radius:50px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    color:white;
    font-weight:bold;
    cursor:pointer;
    transition:.3s;
    box-shadow:0 4px 10px rgba(0,0,0,.15);
}

.categoria:hover{
    transform:translateY(-5px);
}

.categoria i{
    font-size:28px;
}

.categoria span{
    font-size:14px;
    text-align:center;
}

.categoria1{
    background:linear-gradient(to right,#8e24aa,#29b6f6);
}

.categoria2{
    background:linear-gradient(to right,#ff008c,#ff5ea8);
}

.categoria3{
    background:linear-gradient(to right,#7b1fa2,#ab47bc);
}

.categoria4{
    background:linear-gradient(to right,#ff6f00,#ffca28);
}

.categoria5{
    background:linear-gradient(to right,#00cfff,#1565c0);
}

.categoria6{
    background:linear-gradient(to right,#f06292,#ec407a);
}

/* Productos */

.productos{
    padding:50px;
}

.productos h2{
    margin-bottom:30px;
}

.contenedor-productos{
    display:flex;
    justify-content:center;
    gap:30px;
    flex-wrap:wrap;
}

.producto{
    background:white;
    width:280px;
    padding:20px;
    border-radius:15px;
    text-align:center;
    box-shadow:0 0 10px rgba(0,0,0,.1);
    transition:0.3s;
}

.producto:hover{
    transform:translateY(-5px);
}

.producto img{
    width:100%;
    height:200px;
    object-fit:cover;
    border-radius:10px;
}

.producto h3{
    margin-top:15px;
}

.producto p{
    color:#0099ff;
    font-size:22px;
    font-weight:bold;
    margin:10px 0;
}

.producto button{
    background:#ff008c;
    color:white;
    border:none;
    padding:10px 25px;
    border-radius:25px;
    cursor:pointer;
}

.producto button:hover{
    background:#e6007e;
}

/* Responsive Tablet */

@media (max-width: 992px){

    header{
        padding:20px;
        flex-direction:column;
    }

    .buscador{
        width:90%;
    }

    .usuario{
        gap:20px;
    }

    .banner{
        padding-left:40px;
        height:380px;
    }

    .texto-banner h2{
        font-size:42px;
    }

    .submenu-medicamentos{
        left:0;
        width:700px;
        grid-template-columns:repeat(3,1fr);
    }
}

/* Responsive Celular */

@media (max-width: 768px){

    .barra-superior{
        font-size:13px;
        padding:8px;
    }

    header{
        padding:15px;
        flex-direction:column;
        gap:15px;
        text-align:center;
    }

    .logo h1{
        font-size:34px;
    }

    .buscador{
        width:100%;
    }

    .buscador input{
        font-size:14px;
        padding:11px;
    }

    .buscador button{
        padding:11px 16px;
    }

    .usuario{
        width:100%;
        justify-content:center;
        gap:25px;
        font-size:14px;
    }

    nav ul{
        flex-direction:column;
        align-items:center;
    }

    nav ul li{
        margin:10px 0;
    }

    .submenu-medicamentos{
        position:static;
        width:100%;
        margin-top:10px;
        border-radius:15px;
        grid-template-columns:1fr;
        padding:15px;
    }

    .menu-medicamentos:hover .submenu-medicamentos{
        display:grid;
    }

    .banner{
        height:auto;
        min-height:300px;
        padding:40px 20px;
        justify-content:center;
        text-align:center;
    }

    .texto-banner h2{
        font-size:32px;
    }

    .texto-banner p{
        font-size:18px;
    }

    .texto-banner button{
        font-size:16px;
        padding:12px 28px;
    }

    .categorias{
        padding:30px 15px;
    }

    .categorias h2,
    .productos h2{
        text-align:center;
        font-size:24px;
    }

    .categoria{
        width:90%;
        max-width:300px;
    }

    .productos{
        padding:30px 15px;
    }

    .contenedor-productos{
        flex-direction:column;
        align-items:center;
        gap:20px;
    }

    .producto{
        width:100%;
        max-width:330px;
    }

    .producto img{
        height:190px;
    }
}

/* Tu CSS actual */

/* Responsive celular pequeño */

@media (max-width: 480px){

    .logo h1{
        font-size:30px;
    }

    .texto-banner h2{
        font-size:26px;
    }

    .texto-banner p{
        font-size:16px;
    }

    .usuario{
        flex-direction:column;
        gap:10px;
    }

    .categoria{
        height:auto;
        padding:18px;
    }
}

/* PEGA AQUÍ EL NUEVO CÓDIGO */

html,
body{
    width:100%;
    overflow-x:hidden;
}

img{
    max-width:100%;
    height:auto;
}
html,
body{
    overflow-x:hidden;
    max-width:100%;
}
/* ARREGLO FINAL PARA CELULAR */

@media (max-width:768px){

    header{
        width:100%;
        overflow:hidden;
    }

    .logo h1{
        font-size:32px;
    }

    .buscador{
        width:90%;
        max-width:90%;
    }

    nav{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

nav ul{
    display:flex;
    flex-direction:row;
    flex-wrap:nowrap;
    justify-content:flex-start;
    width:max-content;
}

nav ul li{
    margin:10px 20px;
    white-space:nowrap;
}
    .banner{
        width:100%;
        overflow:hidden;
    }

    .texto-banner h2{
        font-size:42px;
        line-height:1.2;
        max-width:100%;
        word-break:normal;
    }

    .texto-banner p{
        font-size:20px;
    }
}

@media (max-width:480px){

    .texto-banner h2{
        font-size:36px;
    }

    .logo h1{
        font-size:30px;
    }
}
/* etc... *//* LOGIN */

.login-menu{
    position: relative;
}

.btn-login{
    display:flex;
    align-items:center;
    gap:8px;
    text-decoration:none;
    color:#222;
    padding:12px 18px;
    border-radius:25px;
    transition:0.3s;
}

/* Cuando pasa el mouse */
.btn-login:hover{
    background:#e6e6e6;
}

/* Menú oculto */
.dropdown-login{
    position:absolute;
    top:55px;
    right:0;
    width:300px;
    background:#fff;
    border-radius:20px;
    padding:15px;
    box-shadow:0 5px 20px rgba(0,0,0,0.15);
    
    opacity:0;
    visibility:hidden;
    transform:translateY(10px);
    
    transition:0.3s;
    z-index:999;
}

/* Mostrar menú al poner mouse */
.login-menu:hover .dropdown-login{
    opacity:1;
    visibility:visible;
    transform:translateY(0);
}

.opcion-login{
    display:block;
    text-align:center;
    text-decoration:none;
    color:#0077d9;
    border:2px solid #0077d9;
    border-radius:30px;
    padding:15px;
    margin:10px 0;
    font-size:14px;
    transition:0.3s;
}

.opcion-login:hover{
    background:#0077d9;
    color:white;
}


.login-menu{
    position: relative;
}

.codigo-acceso{
    position: absolute;
    top: 55px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.20);
    display: none;
    z-index: 9999;
}

.codigo-acceso h3{
    text-align: center;
    font-size: 16px;
    margin-bottom: 10px;
}

.codigo-acceso p{
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.codigo-acceso input{
    width: 100%;
    padding: 14px;
    border: 1px solid #0077d9;
    border-radius: 30px;
    outline: none;
    margin-bottom: 15px;
}

.botones-codigo{
    display: flex;
    gap: 10px;
}

.botones-codigo button{
    flex: 1;
    padding: 12px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
}

.botones-codigo button:first-child{
    background: white;
    border: 1px solid #0077d9;
    color: #0077d9;
}

.botones-codigo button:last-child{
    background: #0077d9;
    border: 1px solid #0077d9;
    color: white;
}