/* Reset / Base */
.hats-wrap {
    font-family: "DM Sans", sans-serif;
    color: #0a0d11;
    margin: 0 auto;
    margin-top: -166px;
}

.hats-wrap *,
.hats-wrap *::before,
.hats-wrap *::after {
    box-sizing: border-box;
}

/* Links */
.hats-links-section {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 13px;
    padding-bottom: 100px;
}

.hats-links-section a {
    font-size: 16px;
    font-weight: 500;
    line-height: 19px;
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 8px;
}

.hats-links-section a:hover {
    color: #ffffff;
}

.wordpress-preview {
    background: #2797ff;
}

.browser-preview {
    background: #0c2045;
}

.buy-link {
    background: #0960ec;
}

/* iFrame */
.hats-iframe-wrap {
    margin-bottom: 48px;
}

.hats-iframe-browser {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d7eeff;
    box-shadow: 0 8px 40px rgba(9, 96, 236, 0.08);
}

.hats-browser-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f5f8ff;
    border-bottom: 1px solid #d7eeff;
}

.hats-browser-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hats-dot-r {
    background: #ff5f57;
}

.hats-dot-y {
    background: #ffbd2e;
}

.hats-dot-g {
    background: #28c840;
}

.hats-browser-url {
    flex: 1;
    background: #fff;
    border: 1px solid #d7eeff;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 13px;
    color: #9d9d9d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-left: 8px;
}

.hats-iframe {
    width: 100%;
    height: 600px;
    border: none;
    display: block;
    background: #f9f9f9;
}

/* Post Header */
.hats-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.hats-post-header-left {
    flex: 1;
    min-width: 0;
}

.hats-post-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: #0a0d11;
    margin: 0 0 8px;
}

.hats-page-count {
    font-size: 14px;
    color: #9d9d9d;
    font-weight: 500;
    display: block;
    margin-bottom: 12px;
}

.hats-short-desc {
    font-size: 18px;
    font-weight: 400;
    line-height: 26px;
    color: #000000;
    margin: 0;
    max-width: 600px;
}

.hats-post-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    flex-shrink: 0;
}

.hats-badge {
    padding: 4px 14px;
    color: #00025c;
    border: 1px solid #0853ff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.hats-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hats-downloads {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 400;
    color: #00025c;
    border: 1px solid #9747ff;
    border-radius: 6px;
    padding: 5px 10px;
}

.hats-get-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: #0960ec;
    color: #fff !important;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.hats-get-btn:hover {
    background: #0748c4;
}

/* Preview Images Grid */
.hats-preview-section {
    margin-bottom: 56px;
}

.hats-preview-grid {
    display: grid;
    gap: 48px;
    grid-template-columns: repeat(3, 1fr);
}

.hats-preview-count-1 {
    grid-template-columns: 1fr;
}

.hats-preview-count-2 {
    grid-template-columns: repeat(2, 1fr);
}

.hats-preview-count-4 {
    grid-template-columns: repeat(4, 1fr);
}

.hats-preview-item {
    overflow: hidden;
}

.hats-preview-item img {
    width: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.hats-preview-item:hover img {
    transform: scale(1.03);
}

/* Tabs */
.hats-tabs-section {
    margin-bottom: 80px;
}

.hats-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #d7eeff;
    margin-bottom: 32px;
}

.hats-tab-btn {
    font-family: "DM Sans", sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 22px;
    color: #4b4b4b;
    background: none;
    border: none;
    padding: 12px 28px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.hats-tab-btn:first-child {
    padding-left: 0;
}

.hats-tab-btn::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0960ec;
    opacity: 0;
    transition: opacity 0.2s;
}

.hats-tab-btn.active {
    color: #0960ec;
}

.hats-tab-btn.active::after {
    opacity: 1;
}

.hats-tab-btn:hover {
    color: #0960ec;
}

.hats-tab-content {
    display: none;
}

.hats-tab-content.active {
    display: block;
}

.hats-tab-body {
    font-size: 18px;
    line-height: 26px;
    font-weight: 400;
    color: #000000;
}

.hats-tab-body h1,
.hats-tab-body h2,
.hats-tab-body h3,
.hats-tab-body h4,
.hats-tab-body h5 {
    color: #0a0d11;
    margin-top: 28px;
    margin-bottom: 12px;
}

.hats-tab-body ul,
.hats-tab-body ol {
    padding-left: 22px;
}

.hats-tab-body li {
    margin-bottom: 6px;
}

.hats-tab-body p {
    margin-bottom: 16px;
}

.hats-tab-body a {
    color: #0960ec;
}

/* Tags tab */
.hats-tags-body {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hats-tag-pill {
    display: inline-block;
    padding: 7px 18px;
    border: 1px solid #d7eeff;
    border-radius: 50px;
    font-size: 14px;
    color: #0a0d11;
    background: #f5f8ff;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    cursor: default;
}

.hats-tag-pill:hover {
    background: #0960ec;
    color: #fff;
    border-color: #0960ec;
}

/* Similar Templates */
.hats-similar-section {
    margin-bottom: 80px;
}

.hats-similar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.hats-similar-title {
    font-size: 24px !important;
    line-height: 29px !important;
    font-weight: 700 !important;
    color: #4b4b4b;
    margin: 0;
}

.hats-browse-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1078ff !important;
    text-decoration: none;
    transition: opacity 0.2s;
}

.hats-browse-all:hover {
    opacity: 0.75;
}

.hats-similar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 14px;
}

.hats-sim-item.hats-sim-hidden {
    display: none;
}

/* Similar Card */
.hats-sim-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 14px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hats-sim-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(9, 96, 236, 0.12);
}

.hats-sim-thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
}

.hats-sim-thumb img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.hats-sim-card:hover .hats-sim-thumb img {
    transform: scale(1.04);
}

.hats-sim-no-thumb {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #c8d8ff 0%, #eef3ff 100%);
}

.hats-sim-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    border-radius: 6px;
}

.hats-sim-card:hover .hats-sim-overlay {
    opacity: 1;
}

.hats-sim-preview-btn {
    padding: 6px 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #fff;
    border-radius: 4px;
}

.hats-sim-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding-top: 14px;
}

.hats-sim-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hats-sim-title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #1078ff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.hats-sim-pages {
    font-size: 12px;
    color: #9d9d9d;
    font-weight: 500;
}

.hats-sim-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.hats-sim-badge {
    padding: 2px 8px;
    color: #00025c;
    border: 1px solid #0853ff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 400;
}

.hats-sim-dl {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #00025c;
    border: 1px solid #9747ff;
    border-radius: 4px;
    padding: 2px 5px;
}

.hats-sim-save {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e36725;
    border-radius: 4px;
    padding: 3px 5px;
    cursor: pointer;
}

/* See More Button */
.hats-see-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.hats-see-more-btn {
    font-family: "DM Sans", sans-serif;
    font-size: 15px;
    font-weight: 500;
    padding: 13px 28px;
    background: #0960ec;
    border: none;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.hats-see-more-btn:hover {
    background: #0748c4;
}

.hats-see-more-wrap.hats-hidden {
    display: none;
}

/* Responsive */
@media (max-width: 1100px) {
    .hats-similar-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hats-preview-grid:not(.hats-preview-count-1):not(.hats-preview-count-2) {
        grid-template-columns: repeat(2, 1fr);
    }

    .hats-wrap {
        margin-top: 0;
    }

    .hats-links-section {
        justify-content: start;
        flex-wrap: wrap;
        padding-bottom: 40px;
    }
}

@media (max-width: 860px) {
    .hats-similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hats-post-header {
        flex-direction: column;
    }

    .hats-post-header-right {
        align-items: flex-start;
    }

    .hats-iframe {
        height: 420px;
    }
}

@media (max-width: 580px) {
    .hats-similar-grid,
    .hats-preview-grid {
        grid-template-columns: 1fr;
    }

    .hats-post-title {
        font-size: 24px;
    }

    .hats-tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .hats-iframe {
        height: 320px;
    }
}
