* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    background-color: #f5f5f5;
    color: #333;
}

input,
button {
    font-family: "Montserrat", sans-serif;
}

.header {
    background-color: #000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 5px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    line-height: 0;
    font-weight: bold;
    color: #333;
}

.logo img {
    max-height: 40px;
    max-width: 100%;
}

.search-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-button {
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.search-button:hover {
    background-color: #0056b3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

@media (max-width: 768px) {
    .catalog-grid {
        grid-template-columns: 1fr;
    }
}

.catalog-item {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 16px 2px #c6c6c6;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.catalog-item:hover {
    box-shadow: 0 3px 16px 2px #878787;
}

.item-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.item-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0, 0, 0, .175);
}

.item-footer>div {
    display: flex;
    align-items: center;
    gap: 2px;
}

.item-footer .item-value {
    font-size: 1.5rem;
    font-weight: 500;
    color: red;
}

.item-details,
.item-footer {
    padding: 1rem;
}

.item-title {
    font-size: 1.375rem;
}

.item-model {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}


.item-specs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.item-icon {
    line-height: 1;
}

.item-icon svg {
    fill: #9c9c9c;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.item-year {
    font-weight: bold;
    color: #007bff;
}

.item-action button {
    width: 100%;
    height: 60px;
    text-align: center;
    border-radius: 0px;
    border: 0px;
    background-color: #25D366;
    color: white;
    font-family: "Montserrat", sans-serif;
    font-size: 1.2rem;
    cursor: pointer;
}

.detail-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.detail-view.active {
    opacity: 1;
    visibility: visible;
}

.detail-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
    z-index: 10;
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.carousel {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #333;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 5;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 5;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.indicator.active {
    background: white;
}

.detail-info {
    padding: 1.5rem;
}

.detail-model {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.detail-specs {
    margin-bottom: 1rem;
}

.detail-spec {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.detail-info .select-item {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.select-button:hover {
    background-color: #218838;
}

.finalize-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.finalize-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

.finalize-button:hover {
    background-color: #0056b3;
}

.finalize-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.info {
    background-color: white;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
}

.info-label {
    font-weight: bold;
}

.footer {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    color: #666;
}

.selected-items-count {
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
    display: none;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}