/* Add these styles to your existing style.css */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    overflow-y: auto; /* Enable scrolling */
}

.cart-content {
    background: white;
    margin: 20px auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    max-height: 90vh; /* Limit height */
    overflow-y: auto; /* Enable scrolling */
    position: relative;
}

/* For smaller screens */
@media (max-width: 768px) {
    .cart-content {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
    }

}

/* Ensure the modal stays centered */
.cart-modal {
    display: flex;
    align-items: flex-start; /* Align to top */
    justify-content: center;
    padding: 20px 0;
}


body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

header {
    background-color: transparent; /* WhatsApp green */
    color: red;
    padding: 3rem;
    text-align: center;
    position: fixed;
    z-index: 999;
    right: 0;
}

.cart-icon {
    position: absolute;
    right: 20px;
    top: 20px;
    cursor: pointer;
    font-size: 1.5rem;
    background: var(--accent-surface-1);
    padding: 0.5em;
    border-radius: 2em;
}

span#cart-count {
    font-weight: 100;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    z-index: -1;
    position: relative;
}

.style{
    margin-block-start: 0em;
}

.mobile-sticky {
    z-index: 1;
    background-color:var(--brand-color);
    height: 100dvh;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position:relative;
}

.product-card h3 {
    
    text-wrap-style: balance;
        height: 3em;
        width:85%;
    overflow: clip;
    transition: height 0.4s;
}

.product-card p {
    
    text-wrap-mode: wrap;
    overflow: clip;
    transition: height 0.4s;
}

.product-card:hover p {
    
    text-wrap-mode: wrap;
    overflow: clip;
    transition: height 1s;
}



.product-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    aspect-ratio: 1;
}

.price {
    font-weight: bold;
    color: #25D366;
    font-size: 1.2rem;
}

button {
    background-color: #25D366;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

button:hover {
    background-color: #128C7E;
}

.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
}

/* For smaller screens */
@media (max-width: 768px) {
    
    .products {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
        padding: 20px;
        z-index: -1;
        position: relative;
    }

    .cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
}



.mobile-sticky {
    z-index: 999;
    background-color:var(--accent-color);
    height:  -webkit-fill-available;
}
}

@media (max-width: 480px) {
 .cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
}
}

.cart-content {
    background: white;
    margin: 0 auto;
    padding: 20px;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

#cart-items {
    margin: 20px 0;
}

input {
    display: block;
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    box-sizing: border-box;
}

/* Previous styles remain the same, add these new styles */

.category-filter {
    display: flex;
    justify-content: left;

    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background-color: transparent;
    position: sticky;
    top: 0;
    z-index: 10;
}

@media (max-width: 1024px) {
  .category-filter {
    display: flex;
    justify-content: center;
    }
}

.category-filter a {
    padding: 8px 15px;
    background-color: #ddd;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.category-filter a.active {
    background-color: #25D366;
    
}

.category-filter a:hover {
    background-color: #ccc;
}

.category-filter a.active:hover {
    background-color: #128C7E;
}

.product-category {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin: 5px 0;
    color: #555;
    position: absolute;
    left: 2em;
}

/* Order confirmation page styles */
.confirmation-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.order-summary {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    white-space: pre-line;
}

.confirm-btn {
    background-color: #25D366;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: block;
    width: 100%;
    margin-top: 20px;
}

.confirm-btn:hover {
    background-color: #128C7E;
}
/* Add to style.css */

.cart-totals {
    margin: 15px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

.cart-totals div {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

#cart-total {
    font-weight: bold;
    border-top: 1px solid #ddd;
    padding-top: 8px;
    margin-top: 8px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.item-info {
    flex: 2;
}

.item-name {
    display: block;
    font-weight: bold;
}

.item-category {
    font-size: 0.8rem;
    color: #666;
}

.item-controls {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.item-controls button {
    padding: 2px 8px;
    margin: 0 3px;
    font-size: 0.9rem;
}

.item-quantity {
    margin: 0 5px;
    min-width: 20px;
    text-align: center;
}

.remove-btn {
    background-color: #ff4444 !important;
    margin-left: 10px !important;
}

.clear-cart-btn {
    background-color: #ff4444;
    margin-top: 10px;
}

.checkout-btn {
    background-color: #25D366;
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    margin-top: 15px;
}

