/**
 * Стили главной страницы (вынесены из inline <style> в index.php).
 * Подключается из index.php через <link> с SITE_TEMPLATE_PATH.
 */

/* --- Плитки разделов каталога (Поиск по категориям) --- */
.tiles1 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 25px;
}

.tile1 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 5px 0 5px;
    border-radius: 12px;
    background-color: #f4f5f7;
    border: 2px solid #f4f5f7;
    box-sizing: border-box;
    min-height: 150px;
    max-height: 160px;
    max-width: 640px;
    min-width: 120px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    justify-content: top;
    text-align: center;
}

.tile1 img {
    width: auto;
    height: 95px;
    flex-shrink: 0;
    opacity: 0.8;
    position: absolute;
    bottom: 0;
    z-index: 1;
}

.tile1-title {
    font-size: 19px;
    font-weight: bold;
    color: #0C0F13;
    line-height: 1.1em;
    z-index: 2;
}

.tile1-count {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #ed1c24;
    opacity: 0.7;
}

.tile1:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    color: #ed1c24;
}

.tile1:hover .tile1-title {
    color: #ed1c24;
}

/* --- Плитки брендов (Поиск по производителям) --- */
.hvr-grow-shadow2 {
    display: inline-block;
    vertical-align: middle;
    -webkit-transform: perspective(1px) translateZ(0);
    transform: perspective(1px) translateZ(0);
    box-shadow: 0 0 1px rgba(0, 0, 0, 0);
    -webkit-transition-duration: 0.3s;
    transition-duration: 0.3s;
    -webkit-transition-property: box-shadow, transform;
    transition-property: box-shadow, transform;
    margin: 3px 8px;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 0.3em;
}

.hvr-grow-shadow2 .tile-brand-title {
    transition: opacity 0.3s ease;
    padding: 3px 10px;
    display: block;
    text-align: center;
}

.hvr-grow-shadow2:hover,
.hvr-grow-shadow2:focus,
.hvr-grow-shadow2:active {
    color: #515151;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    -webkit-transform: scale(1.5);
    transform: scale(1.5);
    background-color: white;
    opacity: 1;
    z-index: 9;
}

.hvr-grow-shadow2 .tile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.hvr-grow-shadow2 img {
    max-width: 85%;
    max-height: 85%;
    width: auto;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    object-fit: contain;
}

.hvr-grow-shadow2:hover img {
    animation: showImage 0.5s forwards;
}

.hvr-grow-shadow2:hover .tile-brand-title {
    animation: hideText 0.5s forwards;
}

.hvr-grow-shadow2:not(:has(img)):hover .tile-brand-title {
    animation: none;
    opacity: 1;
}

.hvr-grow-shadow2 img[src=""]:hover~.tile-brand-title,
.hvr-grow-shadow2 img:not([src]):hover~.tile-brand-title {
    opacity: 1 !important;
    animation: none !important;
}

@keyframes hideText {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes showImage {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
