/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background-color: var(--accent-color);
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.25rem;
    margin-bottom: 5px;
    color: var(--primary-dark);
}

.product-price {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 15px;
}

.add-to-cart-btn {
    margin-top: auto;
    width: 100%;
    padding: 10px;
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    /* Hidden via position */
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 2000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    background-color: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: #ccc;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--text-light);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-btn {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.remove-btn {
    color: #e74c3c;
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: auto;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    background: var(--bg-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

/* Generic Overlay for Drawer & Modals */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Checkout Modal */
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 500px;
    z-index: 2500;
    border-radius: var(--radius);
    padding: 0;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    display: none;
    /* hidden by default */
}

.modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-content {
    padding: 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
}

.payment-window {
    background: #f4f6f2;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
}

.mock-card-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    background: #fff;
    margin-bottom: 10px;
    border-radius: 4px;
}

.card-row {
    display: flex;
    gap: 10px;
}

.checkout-summary {
    background: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.summary-row.total {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0;
}