/* Container styling */
#template-site-container-home {
    display: flex;
    flex-direction: column;
    gap: 20px !important;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.template-grid-container-home {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 20px auto;
}

/* Style for template */
.template-grid-home {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.template-item-home {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex !important;
    transition: all 0.3s ease-in-out;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.template-item-home:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.template-image-home img {
    width: 100%;
    height: auto;
}

.template-image-home {
    position: relative;
    overflow: hidden;
}

.template-image-home::after {
    content: 'Click để xem';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.template-image-home:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.template-content {
    padding: 15px;
    text-align: center;
    flex-grow: 1;
    display: flex !important;
    flex-direction: column;
    justify-content: space-between;
    flex-wrap: wrap;
}

.template-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    flex-grow: 1;
    transition: all 0.3s ease;
}

#template-site-container-home .template-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.loader {
    border: 5px solid #f3f3f3;
    /* Màu nền */
    border-top: 5px solid #5CD85C;
    /* Màu viền trên */
    border-radius: 50%;
    width: 40px;
    /* Đường kính của loader */
    height: 40px;
    /* Đường kính của loader */
    animation: spin 1s linear infinite;
    /* Hiệu ứng quay */
    margin-bottom: 10px;
    justify-items: center;
}

/* Style for spin */
@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#template-site-container-home .template-button-show,
#template-site-container-home .template-button-register {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 12px;
    transition: background-color 0.3s ease, color 0.3s ease;
    width: auto;
    min-width: 100px;
    font-weight: bold;
}

#template-site-container-home .template-button-signup {
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 12px;
    transition: background-color 0.3s ease, color 0.3s ease;
    width: auto;
    min-width: 100px;
    font-weight: bold;
}

.search-template form {
    display: flex;
    align-items: center;
    justify-items: center;
    gap: 10px;
    background: #e8f5e9;
    padding: 8px 15px;
    border-radius: 5px;
    width: 100%;
    transition: all 0.3s ease;
}

.search-template form:focus-within {
    background: #d7ffd9;
}

#search-keyword {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: rgb(12, 12, 12);
}

#search-keyword::placeholder {
    color: rgb(2, 2, 2);
}

#search-input {
    flex: 1;
    padding: 8px;
    font-size: 16px;
    border: 2px solid #ddf8dc;
    border-radius: 5px;
    outline: none;
}

#search-button {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#search-button:hover {
    background: #4CAF50;
    transform: scale(1.05);
}

#search-results {
    margin-bottom: 20px;
}

.elementor-5929 .elementor-element.elementor-element-d896b4d {
    --flex-direction: unset !important;
}

#load-more-search-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}
