/* Scala Cafe Rezervasyon Sistemi - Ürün Seçimi CSS */

.products-container {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.product-categories {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-category {
    background-color: var(--bg-white);
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: visible;
}

.product-category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    padding: 1rem;
    border-bottom: 2px solid var(--primary-color);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
    position: relative;
}

.product-category-header:hover {
    background-color: var(--bg-light);
}

.product-category-header::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.product-category.collapsed .product-category-header::after {
    transform: rotate(-90deg);
}

.product-category-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    background-color: var(--bg-light);
    flex-shrink: 0;
}

.product-category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1.5rem 0;
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 1;
}

.product-category.collapsed .products-list {
    max-height: 0;
    padding: 0;
    opacity: 0;
}

.product-item {
    background-color: var(--bg-light);
    padding: 0.75rem;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.product-item.selected {
    border-color: var(--success-color);
    background-color: #F1F8F4;
}

.product-image-wrapper {
    width: 100%;
    height: 120px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background-color: var(--bg-white);
    flex-shrink: 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.product-quantity-control {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.2rem;
    margin-top: auto;
}

.product-quantity-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--primary-color);
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.product-quantity-btn:hover {
    background-color: var(--bg-light);
}

.product-quantity-input {
    flex: 1;
    text-align: center;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--text-dark);
    width: 30px;
    font-size: 0.9rem;
}

.product-quantity-input:focus {
    outline: none;
}

.selected-items-summary {
    background-color: #F1F8F4;
    border: 2px solid var(--success-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.selected-items-summary h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.selected-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.selected-item-info {
    flex: 1;
    min-width: 150px;
}

.selected-item-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.selected-item-category {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.selected-item-quantity {
    background-color: var(--bg-white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.selected-item-price {
    font-weight: 700;
    color: var(--primary-color);
    min-width: 70px;
    text-align: right;
    white-space: nowrap;
}

.selected-item-remove {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.5rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.selected-item-remove:hover {
    transform: scale(1.2);
}

/* Accordion Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-category:not(.collapsed) .products-list {
    animation: slideDown 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .product-category-header {
        padding: 0.75rem;
    }

    .products-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        padding: 1rem 0;
    }

    .product-image-wrapper {
        height: 100px;
    }

    .product-category-header {
        flex-wrap: wrap;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 0.95rem;
    }

    .selected-item {
        flex-wrap: wrap;
    }

    .selected-item-price {
        width: 100%;
        text-align: right;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .product-category-header {
        padding: 0.75rem 0.5rem;
    }

    .product-category-header::after {
        right: 0.5rem;
    }

    .products-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        padding: 0.75rem 0;
    }

    .product-image-wrapper {
        height: 90px;
    }

    .product-category-image {
        width: 40px;
        height: 40px;
    }

    .product-category-name {
        font-size: 1rem;
    }

    .product-name {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 0.9rem;
    }

    .product-quantity-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .product-quantity-input {
        width: 25px;
        font-size: 0.8rem;
    }
}
