html {
    scrollbar-gutter: stable;
}

body {
    background-color: #d2e0f0;
    margin: 0;
    padding: 25px;
    font-family: 'Montserrat', sans-serif;
}

.wallpaper {
    position: fixed;
    top: -10vh;
    bottom: -10vh;
    left: 0;
    right: 0;
    z-index: -1;
    background: url("img/wallpaper.webp") center / cover no-repeat;
    transform: translateZ(0);
}

.header1 {
    color: #0288d1;
    text-align: center;
    font-size: 18px;
    letter-spacing: 8px;
    padding: 0;
    text-shadow:
        -1px -1px 0px white,
        1px -1px 0px white,
        -1px  1px 0px white,
        1px  1px 0px white,
        2px 2px 4px rgba(0, 0, 0, 0.75);
}

h2 {
    position: relative;
    transition: transform 1s ease-in-out, opacity 1.25s ease-in-out;
    transition-delay: 0.15s, 0s;
    z-index: 2;
    font-family: 'Sora', sans-serif;
    font-size: 22px;
    color: black;
    text-shadow:
        -1px -1px 1px rgba(255, 255, 255, 0.75),
        1px -1px 1px rgba(255, 255, 255, 0.75),
        -1px  1px 1px rgba(255, 255, 255, 0.75),
        1px  1px 1px rgba(255, 255, 255, 0.75),
        1px 1px 3px rgba(0, 0, 0, 0.5);
}


.brand-logos {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(3px);
    /* box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.5); */
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-wrap: wrap;
    padding: 5px 0px 7px 0px;
    gap: 10px;
}

.brand-filter {
    cursor: pointer;
    border-radius: 15px;
    transition: all 1.0s;
}

.brand-filter.inactive {
    opacity: 0.35;
    filter: grayscale(100%);
}

.logo-wrapper {
    width: 100px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.logo-wrapper img {
    max-width: 95%;
    max-height: 95%;
    transition: transform 0.3s ease-in-out;
}

.logo-wrapper img:hover {
    transform: scale(1.2);
}

.container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.card {
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0.6) 0%,
        rgba(205, 230, 255, 0.6) 100%
    );
    /* box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.5); */
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.5); */
    transition: opacity 0.25s ease, transform 0.25s ease;
    will-change: opacity, transform;
}

.card.hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.5);
    pointer-events: none;
    
}

.card img {
    width: 300px !important;
    height: 100px !important;
    object-fit: scale-down;
    margin-top: 10px;
}

.card-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    font-size: 14px;
}

.card:hover .link-image {
    transform: scale(1.45) translateY(-6%) translateX(-9%);
}

.card:hover h2{
    transition-delay: 0s, 2s;
    transform: scale(1.15) translateY(0%) translateX(5%);
    opacity: 0;
}

.link-image {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: transform 1.0s ease-in-out;
    transform-origin: right top;
}

.shine-hover {
    position: relative;
    overflow: hidden;
}

.shine-hover::after {
    pointer-events: none;
    z-index: 3;
    content: "";
    position: absolute;
    top: 0;
    left: -200%;
    width: 120%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 30%,
        rgba(255,255,255,0.1) 55%,
        transparent 70%
    );
    transform: skewX(-10deg);
}

.shine-hover:hover::after,
.card.is-active .shine-hover::after {
    animation: shine 1.5s ease forwards;
    animation-delay: 3s;
}

@keyframes shine {
    from {
        left: -130%;
    }
    to {
        left: 130%;
    }
}

.left, .topleft {
    width: 62%;
    margin-left: 10px;
}

.right {
    width: 38%;
}

.topright {
    width: 100px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.specs {
    display: flex;
    flex-direction: column;
}

.specs div {
    margin-bottom: 4px;
}

.row {
    display: flex;
    align-items: flex-start;
}

.search-sort-container, .header1, .summary{
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Space Grotesk', sans-serif;
    padding: 0;
}

.summary {
    position: relative;
    flex-wrap: wrap;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.last-update {
    padding-right: 25px;
}

.search-bar {
    padding: 10px 0px 10px 0px;
    display: flex;
    flex: 0 0 auto;
    width: 220px;
    transition: max-width 0.35s ease;
}

.search-bar input {
    padding: 4px;
    border-radius: 8px;
    font-size: 12px;
    transition: all 0.4s ease;
    width: 100%;
}

.search-bar input::placeholder {
    color: rgba(0,0,0,0.5);
}

.search-toggle {
    display: none;
    font-size: 20px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sort-options select {
    padding: 4px;
    border-radius: 8px;
    font-size: 12px;
    transition: all 0.4s ease;
}

.search-bar input,
.sort-options select {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(255,255,255,0.4);
    color: black;
}

.sort-options select:hover {
    background-color: rgba(255,255,255,0.8);
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    color: #0288d1;
}

strong {
    color: #0288d1;
}

button {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: white;
    transition: color 0.4s ease;
}

button:hover {
    color: red;
}

.fab-wishlist {
    position: relative;
    bottom: 5px;
    width: 35px;
    height: 35px;
    line-height: 50px;
    background: rgb(2, 136, 209, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    /* box-shadow: 5px 2px 5px rgba(0,0,0,0.3); */
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease-in-out;
}

.fab-wishlist:hover {
    transform: scale(1.2);
    color: white;
}

.wishlist-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.wishlist-modal.active {
    opacity: 1;
    visibility: visible;
}

body:has(.wishlist-modal.active) {
    overflow: hidden;
    touch-action: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    overflow: hidden;
    /* box-shadow: 0 8px 8px rgba(0,0,0,0.35); */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f9fbfd;
    border-bottom: 1px solid #e8ecef;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.35em;
    color: #0288d1;
}

.modal-close {
    font-size: 1.2em;
    color: #777;
    cursor: pointer;
    line-height: 1;
    font-weight: 500;
}

.modal-close:hover {
    color: #e74c3c;
}

.wishlist-list {
    padding: 8px 0;
    overflow-y: auto;
    max-height: 65vh;
    gap: 0;
}

.wishlist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f4f8;
    
}

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

.wishlist-item img {
    width: 140px;
    height: 140px;
    object-fit: scale-down;
    border-radius: 10px;
    flex-shrink: 0;
}

.wishlist-item-info {
    flex: 1;
    font-size: 0.9em;
}

.wishlist-item-name {
    margin: 0 0 4px;
    font-weight: 600;
    font-size: 1.05em;
    text-shadow:
        -1px -1px 1px rgba(255, 255, 255, 0.8),
        1px -1px 1px rgba(255, 255, 255, 0.8),
        -1px  1px 1px rgba(255, 255, 255, 0.8),
        1px  1px 1px rgba(255, 255, 255, 0.8),
        4px 5px 4px rgba(0, 0, 0, 0.2);
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #777;
    font-size: 1.1em;
}

@media (min-width: 1680px) {
    .container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) and (max-width: 1679px) {
    .container {
        grid-template-columns: repeat(3, 1fr);
    }

    .card:hover .link-image {
        transform: scale(1.22) translateY(-5%) translateX(-22%);
    }
}

@media (min-width: 768px) and (max-width: 1279px) {
    .container {
        grid-template-columns: repeat(2, 1fr);
    }

    .card:hover .link-image {
        transform: scale(1.12) translateY(-5%) translateX(-22%);
    }

    .header1 {
        flex-direction: column;
        align-items: flex-start;
    }
    .summary {
        margin-top: 4px;
        padding: 12px;
        font-size: 12.5px;
    }
    .brand-logos{
        padding: 10px 0px 10px 0px;
        gap: 4px;
    }

    .logo-wrapper {
        width: 75px;
    }
}

@media (max-width: 767px) {
    .container {
        grid-template-columns: 1fr;
    }

    .card-content {
        font-size: 12px;
    }
    
    .header1{
        cursor: pointer;
        user-select: none;
        padding: 0;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
        gap: 8px;
        font-size: 14px;
        letter-spacing: 5px;
    }

    h2 {
        font-size: 18px;
    }

    .search-sort-container {
        align-items: stretch;
        justify-content: space-between;
        padding: 10px 0px 10px 0px;
    }

    .sort-options {
        display: flex;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }

    .search-sort-container.search-active .sort-options {
        display: none;
    }
 
    .brand-logos{
        padding: 0px 10px 0px 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-evenly;
        gap: 0px;
    }

    .logo-wrapper {
        width: 60px;
    }

    .logo-wrapper img:hover {
        transform: scale(1);
    }

    .summary {
        display: none;
        padding: 11px;
        bottom: 10px;
        font-size: 12px;
        color: black;
        text-shadow: 0px 0px 0px rgba(0, 0, 0, 0.0);
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.75) 0%,
            rgba(239, 247, 255, 0.75) 100%
        );
        /* box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.5); */
        backdrop-filter: blur(3px);
        border-radius: 15px;
        opacity: 0;
        transform: translateY(-120px);
        transition: 
            opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
            display 0.2s allow-discrete;
    }

    .summary.visible {
        display: grid;
        opacity: 1;
        transform: translateY(0);
        transition: 
            opacity 0.4s ease-out,
            transform 0.4s ease-out,
    }

    @starting-style {
        .summary.visible {
            opacity: 0;
            transform: translateY(-120px);
        }
    }

    .summary span {
        display: inline-block;
        min-width: 110px;
    }

    .search-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
    }

    .search-bar {
        display: none;
        flex: 1;
    }

    .search-bar input{
        width: 60%;
    }

    .search-bar.active {
        display: flex;
        padding: 0px 0px 0px 0px;
    }

    .card:hover .link-image,
    .card.is-active .link-image {
        transform: scale(1.125) translateY(-5%) translateX(-22%);
    }
    
    .card:hover h2, .card.is-active h2 {
        transition-delay: 0s, 2s;
        transform: scale(1.1) translateY(0%) translateX(0%);
        opacity: 0;
    }

    .fab-wishlist {
        position: absolute;
        right: 12px;
        top: 12px;
    }
}