/* ==========================================================================
   Trunexora — styles for the dynamic (database-driven) elements.
   Uses the design tokens declared in styles.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Product filter bar (products.php)
   -------------------------------------------------------------------------- */
.product-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 48px;
    max-width: 900px;
}

.product-filter-bar .filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.product-filter-bar .filter-btn i {
    font-size: 0.88rem;
    opacity: 0.75;
}

.product-filter-bar .filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.product-filter-bar .filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 166, 80, 0.25);
}

.product-filter-bar .filter-btn.active i { opacity: 1; }

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */
.no-products,
.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 72px 24px;
    color: var(--color-text-soft);
}

.no-products i,
.no-posts i {
    font-size: 3rem;
    color: var(--color-border-strong);
    margin-bottom: 18px;
}

.no-products h3,
.no-posts h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Form feedback (contact.php)
   -------------------------------------------------------------------------- */
.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    border-radius: var(--radius-md, 10px);
    margin-bottom: 24px;
    font-size: 0.94rem;
    line-height: 1.5;
    animation: alertIn 0.35s ease;
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-alert i { margin-top: 2px; font-size: 1.05rem; }

.form-alert-success {
    background: rgba(0, 166, 80, 0.08);
    border: 1px solid rgba(0, 166, 80, 0.3);
    color: #046c37;
}

.form-alert-error {
    background: rgba(220, 38, 38, 0.07);
    border: 1px solid rgba(220, 38, 38, 0.28);
    color: #b91c1c;
}

.field-error {
    display: block;
    margin-top: 6px;
    color: #dc2626;
    font-size: 0.83rem;
    font-weight: 500;
}

.form-group input.has-error,
.form-group select.has-error,
.form-group textarea.has-error {
    border-color: #dc2626;
}

/* --------------------------------------------------------------------------
   Top action bar — phone and email are links, so they need the surrounding
   span's colour rather than the browser default.
   -------------------------------------------------------------------------- */
.top-bar-content .contact-info a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.top-bar-content .contact-info a:hover,
.top-bar-content .contact-info a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Footer social links
   -------------------------------------------------------------------------- */
.footer-socials {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.footer-socials a:hover {
    background: var(--color-primary);
    transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   Product detail — sidebar, related products, disclaimer
   -------------------------------------------------------------------------- */
.pd-contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
}

.pd-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.92rem;
    color: var(--color-text-muted);
}

.pd-contact-list li:last-child { border-bottom: none; }
.pd-contact-list li i { color: var(--color-primary); margin-top: 3px; }
.pd-contact-list a { color: var(--color-text-muted); text-decoration: none; }
.pd-contact-list a:hover { color: var(--color-primary); }

.pd-btn-block {
    display: flex !important;
    width: 100%;
    justify-content: center;
}

.pd-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pd-related-list li + li { margin-top: 6px; }

.pd-related-list a {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px;
    border-radius: var(--radius-md, 10px);
    text-decoration: none;
    transition: background 0.2s ease;
}

.pd-related-list a:hover { background: var(--color-bg-muted); }

.pd-related-list img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: var(--radius-sm, 6px);
    background: var(--color-bg-soft);
    flex-shrink: 0;
}

.pd-related-list span { display: flex; flex-direction: column; gap: 2px; }

.pd-related-list strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}

.pd-related-list small { font-size: 0.78rem; color: var(--color-text-soft); }

.pd-disclaimer {
    background: var(--color-bg-soft);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md, 10px);
    padding: 22px 26px;
}

.pd-disclaimer p { font-size: 0.9rem; color: var(--color-text-muted); margin: 0; }

/* --------------------------------------------------------------------------
   Blog post (post.php)
   -------------------------------------------------------------------------- */
/* Blog listing card photos.
   Product shots are packshots on a light background, so they are contained
   rather than cropped — `cover` would slice the top and bottom off the pack. */
.blog-card-image.has-photo {
    overflow: hidden;
    padding: 14px;
}

.blog-card-image.has-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image.has-photo img {
    transform: scale(1.06);
}

.blog-post-image {
    margin: 0 0 32px;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
}

.blog-post-image img { width: 100%; height: auto; display: block; }

.blog-post-excerpt {
    font-size: 1.12rem;
    line-height: 1.7;
    color: var(--color-text-muted);
    padding: 20px 26px;
    background: var(--color-bg-soft);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md, 10px);
    margin-bottom: 32px;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-top: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.blog-post-meta span { display: inline-flex; align-items: center; gap: 7px; }

.blog-post-disclaimer {
    margin-top: 44px;
    padding: 20px 24px;
    background: var(--color-bg-muted);
    border-radius: var(--radius-md, 10px);
    font-size: 0.88rem;
    color: var(--color-text-soft);
    line-height: 1.6;
}

.blog-post-related { margin-top: 64px; }

.blog-post-related h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 28px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .product-filter-bar { gap: 8px; margin-bottom: 32px; }

    .product-filter-bar .filter-btn {
        padding: 9px 16px;
        font-size: 0.85rem;
    }

    .blog-post-excerpt { font-size: 1rem; padding: 16px 20px; }
    .blog-post-meta { gap: 14px; font-size: 0.84rem; }
}
