:root {
    --color-primary: hwb(219 1% 79%); /* Azul cielo suave */
    --color-secondary: #2c3e50; /* Azul marino oscuro */
    --color-background: #f0f8ff; /* Azul muy clarito, casi blanco */
    --color-text: #1a365d; /* Azul oscuro para texto */
    --color-light-text: #fff;
    --color-card-background: #ffffff; /* Blanco puro para las tarjetas */
    --color-shadow: rgb(51, 137, 177); /* Sombra azul suave */
    --color-success: #009213; /* Azul más intenso para precios */
    --footer-height: 4rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
    
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    background-image: url('https://i.pinimg.com/736x/5d/09/40/5d09404be75c3a3ac72c09eb8a6c7852.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow-y: auto; 
}

.header {
    background-color: rgba(255, 0, 64, 0.425); /* Turquesa */
    color: rgb(255, 255, 255);             /* Rosa Neón */
    padding: 1rem;
    
    /* Centrado del texto */
    display: flex;
    justify-content: center;
    align-items: center;
    
    position: relative;
    min-height: 140px;
}

.logo-wendy {
    width: 130px;        
    height: auto;
    border-radius: 50%;
    background-color: white; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);

    /* En PC, flota a la izquierda absoluta */
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.header-texto {
    display: flex;
    flex-direction: column;
    text-align: center;
    color: #ffffff; /* color base del texto */
    text-shadow: 
        0 0 5px #fff,       /* brillo blanco */
        0 0 10px #ffcc00,   /* resplandor amarillo */
        2px 2px 5px #000000;   /* sombra negra */
}

/* --- REGLA PARA CELULARES (Aquí está el arreglo) --- */
@media (max-width: 768px) {
    .header {
        /* En celular, cambiamos a columna (uno arriba del otro) */
        flex-direction: column;
        height: auto;
        padding-bottom: 2rem;
    }

    .logo-wendy {
        /* Quitamos el modo absoluto para que ocupe espacio real */
        position: static; 
        transform: none;
        margin-bottom: 15px; /* Espacio entre logo y texto */
        
        /* Opcional: Hacerlo un poquito más chico en celular */
        width: 100px; 
    }
}


.header h1 {
    font-family: 'Luxurious Roman", serif';
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background-color: var(--color-card-background);
    border-radius: 10px;
    box-shadow: 0 4px 15px var(--color-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    text-align: center;
    padding: 1rem;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-secondary);
}

.product-card p {
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://i.ibb.co/23vNhtFS/Pngtree-pink-pastry-three-dimensional-background-1461883.png');
    background-size: cover;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--color-card-background);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgb(85, 94, 134);
    max-width: 600px;
    width: 90%;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    overflow: hidden;
}

.modal-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.modal-body-scroller {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1rem 0;
    flex-grow: 1;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--color-text);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.modal-content h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 1rem;
}

.modal-content p {
    margin-bottom: 1rem;
}

.toppings-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--color-shadow);
}

.toppings-section h3 {
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.topping-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.topping-item input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.size-selection {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 600;
}

.size-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.size-option input[type="radio"] {
    cursor: pointer;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.9rem;
    min-width: 80px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-light-text);
}

.btn-primary:hover {
    background-color: #0c7e25f3;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: var(--color-light-text);
}

.btn-secondary:hover {
    background-color: #3d3d3d;
    transform: scale(1.05);
}

.btn-tertiary {
    background-color: #e0e0e0;
    color: var(--color-secondary);
}

.btn-tertiary:hover {
    background-color: #bdbdbd;
    transform: scale(1.05);
}

.cart-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgb(255, 254, 239);
    color: var(--color-light-text);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--color-shadow);
    z-index: 15;
    transition: transform 0.2s ease;
}

.cart-icon:hover {
    transform: scale(1.2);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    font-weight: bold;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.toast {
    visibility: hidden;
    min-width: 100px;
    background-color: #00a51b;
    color: #ffffff;
    text-align: center;
    border-radius: 5px;
    padding: 10px;
    position: fixed;
    z-index: 100;
    top: 0px;
    left: 0%;
    white-space: nowrap;
}

.toast.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2s;
    animation: fadein 0.5s, fadeout 0.5s 2s;
}

@keyframes fadein {
    from {top: 100; opacity: 0;}
    to {top: 200px; opacity: 1;}
}

@keyframes fadeout {
    from {top: 10px; opacity: 1;}
    to {bottom: 100px; opacity: 0;}
}

.cart-modal-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

#cart-items {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

#cart-items::-webkit-scrollbar {
    width: 8px;
}

#cart-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#cart-items::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

#cart-items::-webkit-scrollbar-thumb:hover {
    background: #00ff0d;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-name {
    font-weight: 600;
}

.cart-item-price {
    color: var(--color-primary);
    font-weight: bold;
}

.cart-summary {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.cart-total, .cart-subtotal, .cart-shipping {
    text-align: right;
    font-size: 1rem;
    font-weight: bold;
    margin-top: 0.5rem;
    color: var(--color-primary);
}

.cart-total {
    font-size: 1.2rem;
    margin-top: 1rem;
    border-top: 2px solid var(--color-primary);
    padding-top: 0.5rem;
}

.cart-modal-content .modal-actions {
    flex-shrink: 0;
    margin-top: 1rem;
}

.empty-cart-message {
   text-align: center;
   padding: 2rem;
   font-style: italic;
   color: #777;
}  

#modal-product-price {
   font-size: 2rem;
   font-weight: bold;
}

.price-highlight {
   color: var(--color-success) !important;
   animation: pricePulse 0.5s ease;
}

@keyframes pricePulse {
   0% { transform: scale(1); }
   50% { transform: scale(1.1); }
   100% { transform: scale(1); }
}

.quantity-controls {
   display: flex;
   align-items: center;
   gap: 0.5rem;
}

.quantity-btn {
   background-color: var(--color-primary);
   color: var(--color-light-text);
   border: none;
   border-radius: 5px;
   width: 25px;
   height: 25px;
   font-size: 1rem;
   font-weight: bold;
   cursor: pointer;
}

.remove-btn {
   background-color: #dc3545;
   color: var(--color-light-text);
   border: none;
   border-radius: 50%;
   width: 25px;
   height: 25px;
   font-size: 0.8rem;
   font-weight: bold;
   cursor: pointer;
   margin-left: 1rem;
}

.footer {
   background-color: rgba(22, 6, 78, 0.877);
   color: var(--color-light-text);
   text-align: center;
   padding: .8rem 0;
   height: var(--footer-height);
   position: relative;
   bottom: 0;
   width: 100%;
   z-index: 5;
   margin-top: 2rem;
}

.product-images-content {
   display: flex;
   flex-direction: column;
   gap: 1rem;
   align-items: center;
}

.product-images-content img {
   max-width: 100%;
   border-radius: 8px;
   box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(51, 137, 177, 0.2);
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.checkout-modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
    position: relative;
}

.checkout-form-scroll {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px;
    max-height: calc(85vh - 140px);
}

.checkout-form-scroll::-webkit-scrollbar {
    width: 6px;
}

.checkout-form-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.checkout-form-scroll::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 3px;
}

.modal-actions-fixed {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-card-background);
    padding: 1rem 2rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    z-index: 10;
}

@media (max-width: 480px) {
    .modal-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        max-width: 200px;
    }

    .checkout-modal-content {
        padding-bottom: 90px;
    }
    
    .checkout-form-scroll {
        max-height: calc(75vh - 120px);
    }
}