/* Übernommen aus Code Snippets #108 (Produkt-Raster „Perfekt für / Herkunft“) */
/* ==========================================================================
   Custom Product Grid – Stylesheet
   Version: 2.0
   Pfad im Theme: /assets/css/custom-product-grid.css
   Einbindung: wp_enqueue_style() im Frontend-Snippet
   ========================================================================== */


/* --------------------------------------------------------------------------
   Section-Wrapper
   -------------------------------------------------------------------------- */
.custom-grid-section {
    margin: 3rem 0 2rem;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}


/* --------------------------------------------------------------------------
   Zeilen-Layout (Flexbox)
   -------------------------------------------------------------------------- */
.custom-grid-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    gap: 1.5rem;
}


/* --------------------------------------------------------------------------
   Einzelne Box – Karte
   -------------------------------------------------------------------------- */
.custom-grid-box {
    position: relative;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 1rem;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.03);
    transition:
        transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
    box-sizing: border-box;
    overflow: hidden;
}

/* Dezenter Akzent-Strich oben */
.custom-grid-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.25rem;
    right: 1.25rem;
    height: 3px;
    background: linear-gradient(90deg, #114232, #1a6b50);
    border-radius: 0 0 3px 3px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.custom-grid-box:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 24px rgba(17, 66, 50, 0.10),
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.custom-grid-box:hover::before {
    opacity: 1;
}


/* --------------------------------------------------------------------------
   Box – Titel
   -------------------------------------------------------------------------- */
.custom-grid-box .custom-grid-box-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    color: #114232;
    line-height: 1.3;
}


/* --------------------------------------------------------------------------
   Box – Inhalt (Text)
   -------------------------------------------------------------------------- */
.custom-grid-box-content {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #3a3a3a;
}

.custom-grid-box-content p {
    margin: 0 0 0.75rem;
}

.custom-grid-box-content p:last-child {
    margin-bottom: 0;
}

/* Links innerhalb der Boxen */
.custom-grid-box-content a {
    color: #114232;
    text-decoration: underline;
    text-decoration-color: rgba(17, 66, 50, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
}

.custom-grid-box-content a:hover {
    text-decoration-color: #114232;
}


/* --------------------------------------------------------------------------
   Box – Tabellen (falls Attributwerte als Tabelle gerendert werden)
   -------------------------------------------------------------------------- */
.custom-grid-box table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.custom-grid-box table th,
.custom-grid-box table td {
    border: 1px solid #e0e0e0;
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.custom-grid-box table th {
    background-color: #f4f7f5;
    font-weight: 600;
    color: #114232;
    font-size: 0.85rem;
}

.custom-grid-box table tr:last-child td {
    border-bottom: 1px solid #e0e0e0;
}

/* Zebra-Striping für bessere Lesbarkeit */
.custom-grid-box table tbody tr:nth-child(even) {
    background-color: #fafbfa;
}


/* --------------------------------------------------------------------------
   Box – Listen (falls Attributwerte als <ul>/<ol> gerendert werden)
   -------------------------------------------------------------------------- */
.custom-grid-box-content ul,
.custom-grid-box-content ol {
    margin: 0.5rem 0 0.75rem;
    padding-left: 1.25rem;
}

.custom-grid-box-content li {
    margin-bottom: 0.3rem;
    line-height: 1.5;
}


/* --------------------------------------------------------------------------
   Responsive – Tablet (max 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .custom-grid-section {
        gap: 1.5rem;
    }

    .custom-grid-row {
        gap: 1.25rem;
    }

    .custom-grid-box {
        padding: 1.5rem 1.25rem 1.25rem;
    }
}


/* --------------------------------------------------------------------------
   Responsive – Mobile (max 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .custom-grid-section {
        margin: 2rem 0 1.5rem;
        gap: 1rem;
    }

    .custom-grid-row {
        gap: 1rem;
    }

    .custom-grid-box {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding: 1.25rem 1rem 1rem;
        border-radius: 0.75rem;
    }

    /* Hover-Effekt auf Touch-Geräten deaktivieren */
    .custom-grid-box:hover {
        transform: none;
        box-shadow:
            0 1px 3px rgba(0, 0, 0, 0.04),
            0 4px 12px rgba(0, 0, 0, 0.03);
    }

    .custom-grid-box:hover::before {
        opacity: 0;
    }

    .custom-grid-box .custom-grid-box-title {
        font-size: 0.75rem;
    }

    .custom-grid-box-content {
        font-size: 0.9rem;
    }
}


/* --------------------------------------------------------------------------
   Responsive – Kleine Phones (max 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .custom-grid-box {
        padding: 1rem 0.85rem;
    }

    .custom-grid-box table th,
    .custom-grid-box table td {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }
}
