/* KW Intranet Produkte – Frontend Styles */

/* ─── Produkt-Grid ─── */
/* KW Intranet Products Plugin Styles */

/* Search Form */
.kw-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.kw-search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}
.kw-search-select {
    min-width: 180px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.4;
    min-height: 3rem;
    box-sizing: border-box;
    background: #fff;
}
.kw-search-btn {
    padding: 0.75rem 1.5rem;
    background: #333;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.kw-search-btn:hover {
    background: #111;
}

/* Absence Notice */
.kw-absence-notice {
    width: 100%;
    background: #fff9e6;
    border-bottom: 2px solid #f0c04a;
    border-left: 8px solid #f0c04a;
    color: #333;
    padding: 12px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 3px 5px rgba(0,0,0,0.08);
    margin: 1rem 0 1.5rem;
}

.kw-absence-notice-inner {
    max-width: 1200px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.kw-absence-notice-badge {
    background: #f0c04a;
    color: #856404;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.kw-absence-notice-message {
    color: #333;
}

.kw-absence-notice-signature {
    color: #856404;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 5px;
    padding-left: 10px;
}

/* Product Grid */
.kw-products {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.kw-products.kw-grid-auto {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.kw-products.kw-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.kw-products.kw-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.kw-products.kw-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}
.kw-products.kw-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}
.kw-products.kw-grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Product Card */
.kw-product-card {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kw-product-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none;
    color: inherit;
}

.kw-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.kw-product-img {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
}
.kw-product-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.kw-product-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    color: #999;
    font-size: 0.9rem;
}

.kw-product-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.kw-product-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}
.kw-product-brand {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
}
.kw-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #777;
}
.kw-product-meta span {
    padding: 0.25rem 0.5rem;
    background: #f0f0f0;
    border-radius: 3px;
}

.kw-product-meta-item--ewb {
    background: #fff3cd;
    color: #856404;
}

.kw-product-meta-item--tag {
    background: #eef2ff;
    color: #374151;
}

.kw-product-price {
    margin-top: auto;
    margin-top: 0.75rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}
.kw-product-price small {
    display: block;
    font-size: 0.75rem;
    font-weight: normal;
    color: #888;
    margin-top: 0.25rem;
}
.kw-product-price--ask {
    color: #d9534f;
}

.kw-no-products {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Pagination */
.kw-pagination {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0;
    align-items: center;
}
.kw-pagination-info {
    color: #666;
    font-size: 0.9rem;
}
.kw-pagination-pages {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.kw-page-link {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}
.kw-page-link:hover {
    background: #f5f5f5;
}
.kw-page-current {
    background: #333;
    color: white;
    border-color: #333;
}
.kw-page-dots {
    padding: 0.5rem;
    color: #999;
}

/* Detail Page */
.kw-detail {
    margin: 2rem 0;
}
.kw-detail-back {
    margin: 0 0 1.5rem 0;
}
.kw-detail-back a {
    text-decoration: none;
    color: #0066cc;
}
.kw-detail-back a:hover {
    text-decoration: underline;
}

.kw-detail-title {
    margin: 0 0 1.5rem 0;
    font-size: 2rem;
    font-weight: 600;
}

.kw-detail-gallery {
    margin-bottom: 2rem;
}
.kw-detail-main-img {
    width: 100%;
    max-width: 600px;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    cursor: pointer;
}
.kw-detail-main-img img {
    width: 100%;
    height: auto;
    display: block;
}

.kw-detail-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}
.kw-detail-thumb {
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.kw-detail-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.kw-detail-thumb img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.kw-detail-content {
    max-width: 800px;
}

.kw-detail-specs {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}
.kw-detail-spec {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}
.kw-detail-spec:last-child {
    border-bottom: none;
}
.kw-detail-spec-label {
    font-weight: 600;
    color: #333;
}
.kw-detail-spec-value {
    color: #666;
}
.kw-detail-spec-value small {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.25rem;
}

.kw-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.kw-detail-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}
.kw-detail-badge--ewb {
    background: #fff3cd;
    color: #856404;
}
.kw-detail-badge--info {
    background: #d1ecf1;
    color: #0c5460;
    text-decoration: none;
}

.kw-detail-badge--tag {
    background: #eef2ff;
    color: #374151;
}

.kw-detail-price {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}
.kw-detail-price small {
    display: block;
    font-size: 0.75rem;
    font-weight: normal;
    color: #888;
    margin-top: 0.25rem;
}

.kw-detail-desc {
    line-height: 1.6;
    color: #555;
}

/* Lightbox */
.kw-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.kw-lightbox[hidden] {
    display: none;
}
.kw-lightbox-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}
.kw-lightbox-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.kw-lightbox-close,
.kw-lightbox-prev,
.kw-lightbox-next {
    position: absolute;
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}
.kw-lightbox-close:hover,
.kw-lightbox-prev:hover,
.kw-lightbox-next:hover {
    background: rgba(255,255,255,0.2);
}
.kw-lightbox-close {
    top: 1rem;
    right: 1rem;
}
.kw-lightbox-prev {
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
}
.kw-lightbox-next {
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
}
.kw-lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .kw-products.kw-grid-3,
    .kw-products.kw-grid-4,
    .kw-products.kw-grid-5,
    .kw-products.kw-grid-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .kw-detail-title {
        font-size: 1.5rem;
    }
    
    .kw-detail-spec {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kw-products.kw-grid-2,
    .kw-products.kw-grid-3,
    .kw-products.kw-grid-4,
    .kw-products.kw-grid-5,
    .kw-products.kw-grid-6 {
        grid-template-columns: 1fr;
    }
    
    .kw-search {
        flex-direction: column;
    }
    
    .kw-search-input,
    .kw-search-btn {
        width: 100%;
    }
}

.kw-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
}
.kw-product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.kw-product-img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f5f5;
}
.kw-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.kw-product-card:hover .kw-product-img img {
    transform: scale(1.04);
}
.kw-product-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: .9rem;
}

.kw-product-info {
    padding: 1rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kw-product-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 .3rem;
    line-height: 1.3;
    color: #222;
}

.kw-product-brand {
    font-size: .85rem;
    color: #666;
    margin: 0 0 .5rem;
}

.kw-product-meta {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.kw-product-meta span {
    font-size: .75rem;
    background: #f0f0f0;
    color: #555;
    padding: .2rem .5rem;
    border-radius: 4px;
}

.kw-product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a6b1a;
    margin: auto 0 0;
    padding-top: .5rem;
}
.kw-product-price small {
    display: block;
    font-size: .7rem;
    font-weight: 400;
    color: #888;
    margin-top: .15rem;
}
.kw-product-price--ask {
    color: #555;
    font-weight: 500;
    font-size: .95rem;
}

.kw-no-products {
    text-align: center;
    color: #888;
    padding: 3rem 1rem;
    font-size: 1.1rem;
}

/* ─── Suchformular ─── */
.kw-search {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    max-width: 500px;
}
.kw-search-input {
    flex: 1;
    padding: .55rem .8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: .95rem;
}
.kw-search-input:focus {
    outline: none;
    border-color: #1a6b1a;
    box-shadow: 0 0 0 2px rgba(26,107,26,.15);
}
.kw-search-btn {
    padding: .55rem 1.2rem;
    background: #1a6b1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    cursor: pointer;
    transition: background .2s;
}
.kw-search-btn:hover { background: #145514; }

/* ─── Pagination ─── */
.kw-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin: 2rem 0;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}
.kw-pagination-info {
    font-size: .85rem;
    color: #888;
}
.kw-pagination-pages {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.kw-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    font-size: .9rem;
    color: #333;
    background: #fff;
    transition: all .2s;
}
.kw-page-link:hover {
    border-color: #1a6b1a;
    color: #1a6b1a;
    background: #f0faf0;
}
.kw-page-current {
    background: #1a6b1a;
    color: #fff;
    border-color: #1a6b1a;
    font-weight: 600;
}
.kw-page-dots {
    padding: 0 .3rem;
    color: #aaa;
}

/* ─── Detailansicht ─── */
.kw-detail {
    max-width: 960px;
    margin: 2rem auto;
}

.kw-detail-back a {
    font-size: .9rem;
    text-decoration: none;
    color: #555;
}
.kw-detail-back a:hover { color: #111; }

.kw-detail-gallery {
    margin-bottom: 1.5rem;
}
.kw-detail-main-img {
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    margin-bottom: .5rem;
}
.kw-detail-main-img img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    display: block;
}
.kw-detail-thumbs {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.kw-detail-thumb {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .2s;
}
.kw-detail-thumb:hover {
    border-color: #1a6b1a;
}
.kw-detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.kw-detail-content {
    margin-top: 1.5rem;
}

.kw-detail-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: #222;
}

.kw-detail-specs {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}
.kw-detail-specs th,
.kw-detail-specs td {
    padding: .6rem .8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: .95rem;
}
.kw-detail-specs th {
    font-weight: 600;
    color: #555;
    width: 160px;
}
.kw-detail-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a6b1a;
}
.kw-detail-price small {
    font-size: .75rem;
    font-weight: 400;
    color: #888;
    margin-left: .5rem;
}

.kw-detail-desc {
    line-height: 1.7;
    color: #333;
    font-size: .95rem;
}
.kw-detail-desc h1,
.kw-detail-desc h2,
.kw-detail-desc h3 {
    margin: 1rem 0 .5rem;
    color: #222;
}
.kw-detail-desc p { margin: 0 0 .8rem; }
.kw-detail-desc ul, .kw-detail-desc ol { padding-left: 1.5rem; margin: 0 0 .8rem; }
.kw-detail-desc blockquote {
    border-left: 3px solid #ddd;
    padding-left: 1rem;
    color: #666;
    margin: .8rem 0;
}

/* ─── Lightbox ─── */
.kw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
}
.kw-lightbox[hidden] { display: none; }

.kw-lightbox-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kw-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
    user-select: none;
}

.kw-lightbox-close,
.kw-lightbox-prev,
.kw-lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    opacity: .7;
    transition: opacity .2s;
}
.kw-lightbox-close:hover,
.kw-lightbox-prev:hover,
.kw-lightbox-next:hover { opacity: 1; }
.kw-lightbox-close { top: 1rem; right: 1.2rem; font-size: 2.2rem; line-height: 1; }
.kw-lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); font-size: 3rem; line-height: 1; }
.kw-lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); font-size: 3rem; line-height: 1; }
.kw-lightbox-counter {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: .85rem;
}

/* ─── Mobile ─── */
@media (max-width: 600px) {
    .kw-products {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    .kw-search { max-width: 100%; }
    .kw-pagination { justify-content: center; }
    .kw-pagination-info { width: 100%; text-align: center; }
    .kw-detail-main-img img { max-height: 300px; }
    .kw-detail-thumb { width: 56px; height: 42px; }
    .kw-detail-specs th { width: 110px; }
}
