/* ========== Main Layout ========== */
.wc-kiosk-pro {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========== Categories Navigation ========== */
.wc-kiosk-categories {
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
}

.wc-kiosk-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wc-kiosk-categories li {
    padding: 12px 15px;
    margin-bottom: 5px;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.wc-kiosk-categories li:hover,
.wc-kiosk-categories li.active {
    background: #e9ecef;
    color: #007bff;
}

.wc-kiosk-categories li.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ========== Products Grid ========== */
.wc-kiosk-products {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    align-content: start;
    overflow-y: auto;
    background: #fff;
}

.wc-kiosk-products.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.wc-kiosk-products.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.wc-kiosk-products-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* ========== Product Cards ========== */
.wc-kiosk-product {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
    background: #fff;
}

.wc-kiosk-product:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-image {
    height: 180px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.wc-kiosk-product:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
}

.product-info h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
    color: #343a40;
}

.product-price {
    font-weight: bold;
    color: #28a745;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* ========== Quantity Selector ========== */
.quantity-selector {
    display: flex;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
}

.quantity-selector button {
    width: 30px;
    height: 30px;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector button:hover {
    background: #e9ecef;
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #ced4da;
    border-right: 1px solid #ced4da;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ========== Add to Cart Button ========== */
.add-to-cart,
.show-variations,
.add-variation-to-cart {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    background: #28a745;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.add-to-cart:hover,
.show-variations:hover,
.add-variation-to-cart:hover {
    background: #218838;
}

.add-to-cart.loading,
.show-variations.loading,
.add-variation-to-cart.loading {
    background: #6c757d;
    position: relative;
    padding-left: 35px;
}

.add-to-cart.loading::after,
.show-variations.loading::after,
.add-variation-to-cart.loading::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== Variations ========== */
.variations-container {
    margin-top: 15px;
}

.wc-kiosk-variations-form {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.variation {
    margin-bottom: 15px;
}

.variation label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.variation select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

.variation-price {
    font-weight: bold;
    margin: 15px 0;
    color: #28a745;
    font-size: 1.2rem;
}

/* ========== Cart Sidebar ========== */
.wc-kiosk-cart {
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

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

.wc-kiosk-cart h3 {
    margin: 0;
    font-size: 1.2rem;
}

.cart-items-count {
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.wc-kiosk-cart-content {
    flex-grow: 1;
    overflow-y: auto;
}

/* ========== Mini Cart ========== */
.widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.woocommerce-mini-cart {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.woocommerce-mini-cart-item {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
}

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

.woocommerce-mini-cart-item a {
    color: #343a40;
    text-decoration: none;
}

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

.woocommerce-mini-cart-item .quantity {
    display: block;
    color: #6c757d;
    font-size: 0.9rem;
}

.woocommerce-mini-cart-item .remove {
    color: #dc3545;
    margin-left: auto;
    font-size: 1.2rem;
    line-height: 1;
}

.woocommerce-mini-cart__total {
    padding: 15px 0;
    border-top: 1px solid #e0e0e0;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
}

/* ========== View Cart Button ========== */
.view-cart {
    display: block;
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.2s;
}

.view-cart:hover {
    background: #0069d9;
    color: white;
}

/* ========== Messages ========== */
.product-message {
    font-size: 0.9rem;
    padding: 5px;
    margin-top: 10px;
    border-radius: 4px;
    display: none;
}

.product-message.success {
    background: #d4edda;
    color: #155724;
}

.product-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* ========== Animations ========== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
    .wc-kiosk-pro {
        grid-template-columns: 200px 1fr;
    }
    
    .wc-kiosk-cart {
        grid-column: 1 / -1;
        height: auto;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
}

@media (max-width: 768px) {
    .wc-kiosk-pro {
        grid-template-columns: 1fr;
    }
    
    .wc-kiosk-categories {
        display: none; /* Replace with mobile menu toggle */
    }
    
    .wc-kiosk-products {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .wc-kiosk-products {
        grid-template-columns: 1fr;
    }
}