/* Global Styles */
body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    font-size: 16px; /* Base font size */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1abc9c;
    font-size: 2rem; /* Responsive heading */
}

/* Vibrating Animation */
@keyframes vibrate {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Search Bar Styles */
.search-container {
    position: relative;
    margin-bottom: 40px;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

#productSearch {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #1abc9c;
    border-radius: 25px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
}

/* Add animation on focus */
#productSearch:focus {
    border-color: #16a085;
    box-shadow: 0 0 5px #16a085;
    animation: vibrate 0.5s ease; /* Add vibration effect */
}

.search-results {
    position: absolute;
    width: 100%;
    border: 1px solid #ccc;
    border-top: none;
    background-color: #fff;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 10px 10px;
    z-index: 1000;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-results div {
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-results div:hover {
    background-color: #f0f0f0;
}

/* Cart Styles */
.cart-container {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding: 20px 0;
    animation: fadeIn 0.5s ease;
}

.cart-item:last-child {
    border-bottom: none;
}

.product-image img {
    width: 80px;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.product-image img:hover {
    transform: scale(1.1);
}

.product-details {
    flex: 1;
    margin-left: 1rem;
}

.product-details h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.product-details p {
    margin: 5px 0;
    color: #777;
}

.product-price p {
    font-size: 1.1rem;
    color: #1abc9c;
}

.cart-summary {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.cart-summary p,
.cart-summary h3 {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-size: 1rem;
}

.cart-summary h3 {
    font-size: 1.3rem;
    color: #1abc9c;
}

.checkout-btn,
.back-home-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-family: 'Nunito', sans-serif;
    text-align: center;
    width: 100%;
}

.checkout-btn {
    background-color: #1abc9c;
    color: #fff;
    width: 190px;
    border: transparent;
}

.checkout-btn:hover {
    background-color: #16a085;
    transform: scale(1.05);
}

.back-home-btn {
    background-color: #e74c3c;
    color: #fff;
    width: 200px;
    border: transparent;
}

.back-home-btn:hover {
    background-color: #c0392b;
    transform: scale(1.05);
}

.cart-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
    border: transparent;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    .cart-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .cart-summary h2 {
        font-size: 1.25rem;
        margin-bottom: 10px;
    }

    .checkout-btn,
    .back-home-btn {
        width: 48%;
    }

    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-image img {
        width: 60px;
    }

    .product-details h2 {
        font-size: 1rem;
    }

    .product-details p {
        font-size: 0.9rem;
    }

    .product-price p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    #productSearch {
        padding: 10px;
        font-size: 0.9rem;
    }

    .cart-item {
        padding: 10px 0;
    }

    .product-image img {
        width: 50px;
    }

    .cart-summary h2 {
        font-size: 1rem;
    }

    .cart-summary h3 {
        font-size: 1.1rem;
    }

    .checkout-btn,
    .back-home-btn {
        padding: 10px;
        font-size: 0.9rem;
        width: 100%;
    }

    .cart-buttons {
        flex-direction: column;
        gap: 15px;
    }
}
