/* Shop Components */

/* Product Grid (Existing but refined) */
.shop-grid {
    /* display: grid;  <-- Removing grid layout for the container */
    /* grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); */
    /* gap: 30px; */
    margin-top: 30px;
    display: block; /* Allow categories to stack vertically */
}

/* Horizontal scrolling for products within a category */
.products-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
    padding: 20px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e74c3c rgba(255, 255, 255, 0.1);
    align-items: stretch; /* Ensure cards have same height */
}

.products-grid::-webkit-scrollbar {
    height: 8px;
}

.products-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.products-grid::-webkit-scrollbar-thumb {
    background: #e74c3c;
    border-radius: 4px;
}

.products-grid::-webkit-scrollbar-thumb:hover {
    background: #c0392b;
}

/* Ensure product cards work in this layout (overrides or complements styles.css) */
.product-card {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    margin-bottom: 10px; /* Spacing for scrollbar */
}

/* Cart Container */
.cart-container {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.cart-header h3 {
    margin: 0;
    color: #e74c3c;
}

.close-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #fff;
}

/* Cart Items */
.cart-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    padding: 15px 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    color: #fff;
}

.cart-item-price {
    color: #ccc;
    font-size: 0.9rem;
    margin: 0;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin: 0 15px;
}

.cart-item-quantity button {
    background: #333;
    border: none;
    color: #fff;
    width: 25px;
    height: 25px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.cart-item-quantity input {
    width: 35px;
    text-align: center;
    background: transparent;
    border: none;
    color: #fff;
    margin: 0 5px;
}

.remove-item-btn {
    background: none;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background: #e74c3c;
    color: #fff;
}

/* Cart Summary */
.cart-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #333;
    text-align: right;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    margin-left: 10px;
}

.checkout-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.2s;
}

.checkout-button:hover {
    background-color: #218838;
}

/* Shipment Form */
.shipment-form {
    background-color: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid #333;
    animation: slideDown 0.3s ease;
}

.shipment-form h3 {
    color: #e74c3c;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #e74c3c;
    outline: none;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
}

.cancel-button {
    background-color: #444;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
}

.place-order-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    flex-grow: 1;
    margin-left: 15px;
}

.place-order-button:hover {
    background-color: #c0392b;
}

.place-order-button:disabled {
    background-color: #666;
    cursor: not-allowed;
}

/* Order Confirmation */
.order-confirmation {
    text-align: center;
    padding: 40px;
    background-color: #1a1a1a;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid #28a745;
}

.order-confirmation h3 {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 15px;
}

.continue-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
