/*
Theme Name: TrackMarket
Theme URI: https://trackmarket.sk
Author: TrackMarket
Description: Custom marketplace theme for trackmarket.sk
Version: 1.0
*/

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #0f1115;
    color: #e5e5e5;
    font-family: system-ui, sans-serif;
}

.layout {
    display: flex;
    min-height: calc(100vh - 70px); /* mínus header */
}

.main-header {
    background: #111827;
    border-bottom: 1px solid #1f2937;
    padding: 0 40px;

    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-weight: bold;
    font-size: 20px;
    color: #facc15; /* gold accent */
}

/* MENU */

.main-menu ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-menu ul li {
    display: inline-block;
}

.main-menu ul li a {
    text-decoration: none;
    color: #e5e5e5;
    font-weight: 500;
    transition: 0.3s;
}

.main-menu ul li a:hover {
    color: #1d4ed8; /* blue hover */
}

.main-menu ul li.current-menu-item a {
    color: #facc15;
    border-bottom: 2px solid #facc15;
    padding-bottom: 4px;
}

.sidebar {
    background: #111827;
    border-right: 1px solid #1f2937;
    width: 180px;
    min-height: 100%;
    padding: 30px 20px;
}

.content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================= */
/* HERO SLIDER */
/* ============================= */

.hero-slider {
    position: relative;
    height: 480px; /* pevná výška */
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 60px;
}

/* každý slide */

.hero-slide {
    position: absolute;
    inset: 0;
    display: none;

    background-size: cover;       /* 🔥 obrázok sa prispôsobí */
    background-position: center;  /* stredové orezanie */
    background-repeat: no-repeat;
}

.hero-slide.active {
    display: flex;
    align-items: center;
    padding: 0 20px;
}

/* tmavý overlay pre čitateľnosť */

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,0.75),
        rgba(0,0,0,0.4)
    );
}

/* obsah */

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* nadpis */

.hero-content h1 {
    font-size: 52px;
    line-height: 1.1;
    font-weight: 700;
    color: #ffffff;
}

/* text */

.hero-content p {
    font-size: 19px;
    color: #e5e7eb;
}

/* tlačidlo zostáva rovnaké */

.btn-primary {
    display: inline-block;
    width: fit-content; /* zabráni roztiahnutiu */
    background: #1d4ed8;
    color: white;
    padding: 14px 26px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

@media (max-width: 1100px) {
    .hero-slider {
        height: 420px;
    }

    .hero-content h1 {
        font-size: 42px;
    }
}

@media (max-width: 768px) {
    .hero-slider {
        height: 360px;
    }

    .hero-slide.active {
        padding: 0 20px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 16px;
    }
}

/* SECTION HEADINGS */

section h2 {
    margin-bottom: 20px;
    font-size: 22px;
    color: #facc15; /* gold accent */
}

/* CATEGORY GRID */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.category-card {
    background: #1f2937;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.25s ease;
    border: 1px solid #2d3748;
}

.category-card:hover {
    border-color: #facc15;
    transform: translateY(-3px);
}

.categories-grid a.category-card {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.categories-grid a.category-card:visited {
    color: inherit;
}

.categories-grid a.category-card:hover {
    color: inherit;
}

.category-card .title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #e5e5e5;
}

/* LISTINGS */

.listings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    align-items: stretch;
}

.listing-card {
    background: #1f2937;
    border-radius: 10px;
    transition: 0.3s;
    border: 1px solid #2d3748;
    overflow: hidden;
    position: relative;

    display: flex;            
    flex-direction: column;   
    height: 100%;             
    min-height: 320px;
}

.listing-card:hover {
    transform: translateY(-4px);
    border-color: #facc15;
    box-shadow: 0 0 0 1px #facc15;
}

.listing-card .image {
    height: 170px;
    background: #111827;
    border-radius: 6px;
    margin-bottom: 12px;
}

.listing-card .price {
    color: #facc15;
    font-weight: bold;
    margin-top: auto;   /* 🔥 toto ju zatlačí dole */
}

.listing-card.premium {
    border: 1px solid #facc15;
}

.listing-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.listing-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
    padding: 5px;
}

.listing-card-link:hover {
    text-decoration: none;
}

.listing-overlay-link {
    display: none;
}

.listing-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.listing-title {
    font-size: 18px;
    margin-bottom: 10px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ARTICLES */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 20px;
}

.article-card {
    background: #1f2937;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #2d3748;
}

.article-card h3 {
    margin-top: 10px;
    font-size: 18px;
}

.article-card a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}
/* Pagination */

.pagination {
    margin-top: 30px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
}

.pagination a.active {
    background: #111;
    color: #fff;
}

/* ============================= */
/* SINGLE LISTING */
/* ============================= */

.single-listing .listing-top {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 20px;
    margin-bottom: 60px;
    align-items: start;
}

/* ============================= */
/* GALLERY */
/* ============================= */

.listing-gallery {
    width: 100%;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 520px;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid #2d3748;
    touch-action: pan-y;
}

.gallery-image {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}

.gallery-image.active {
    display: block;
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.65);
    border: none;
    color: #fff;
    font-size: 26px;
    padding: 14px 18px;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.2s ease;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(0,0,0,0.85);
}

.gallery-prev { left: 18px; }
.gallery-next { right: 18px; }

.gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: 0.2s;
}

.gallery-thumb.active {
    opacity: 1;
    border-color: #facc15;
}

.gallery-thumb:hover {
    opacity: 1;
}

/* ============================= */
/* GALLERY CARD WRAPPER */
/* ============================= */

.listing-gallery-card {
    background: #1f2937;
    padding: 25px;
    border-radius: 14px;
    border: 1px solid #2d3748;
}

/* ============================= */
/* SUMMARY PANEL */
/* ============================= */

.listing-summary {
    background: #1f2937;
    padding: 35px;
    border-radius: 14px;
    border: 1px solid #2d3748;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* TITLE */

.listing-summary .listing-title {
    font-size: 30px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* CATEGORY BADGE */

.listing-category a {
    background: #1d4ed8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: white;
    text-decoration: none;
    display: inline-block;
}

.listing-category a:hover {
    background: #2563eb;
}

/* PRICE */

.listing-price {
    font-size: 34px;
    font-weight: 700;
    color: #facc15;
    margin-top: 5px;
}

/* LOCATION */

.listing-location {
    font-size: 14px;
    color: #9ca3af;
}

.listing-location a {
    color: #9ca3af;
    text-decoration: none;
}

.listing-location a:hover {
    color: #facc15;
}

/* META */

.listing-meta {
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #2d3748;
    padding-top: 15px;
}

/* SELLER BOX */

.seller-box {
    background: #111827;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #2d3748;
    font-size: 14px;
}

/* CONTACT BUTTON */

.contact-btn {
    margin-top: 10px;
}

/* ============================= */
/* DESCRIPTION SECTION */
/* ============================= */

.listing-section {
    margin-bottom: 70px;
}

.listing-section h2 {
    margin-bottom: 25px;
    font-size: 22px;
    color: #facc15;
}

.listing-description {
    background: #1f2937;
    padding: 30px;
    border-radius: 14px;
    border: 1px solid #2d3748;
    line-height: 1.7;
    font-size: 15px;
}

/* ============================= */
/* DETAILS GRID */
/* ============================= */

.listing-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.listing-details-grid div {
    background: #1f2937;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #2d3748;
    font-size: 14px;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */

@media (max-width: 1100px) {

    .single-listing .listing-top {
        grid-template-columns: 1fr;
    }

    .gallery-main {
        height: 400px;
    }
}

@media (max-width: 768px) {

    .gallery-main {
        height: 320px;
    }

    .listing-summary {
        padding: 25px;
    }

    .listing-price {
        font-size: 28px;
    }

    .listing-details-grid {
        grid-template-columns: 1fr;
    }
}