/*
Theme Name: STAL-DREW
Theme URI: https://www.stal-drew.com.pl
Author: Adnet Polska
Author URI: https://adnetpolska.pl
Description: Motyw dla firmy STAL-DREW - producent ogrodzeń, bram i balustrad z Krakowa.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: staldrew
*/

/* Smooth scroll + prevent horizontal overflow from full-bleed sections */
html { scroll-behavior: smooth; overflow-x: hidden; }

/* Hero diagonal clip */
.hero-clip {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

@media (min-width: 768px) {
    .hero-clip {
        clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
    }
}

/* Category card hover lift */
.cat-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* Feature icon pulse */
.feature-icon {
    transition: transform 0.3s ease;
}
.feature-icon:hover {
    transform: scale(1.1);
}

/* Stat counter animation */
.stat-block {
    position: relative;
}
.stat-block::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 50%;
    width: 1px;
    background: rgba(255,255,255,0.2);
}
.stat-block:last-child::after {
    display: none;
}

/* Gallery overlay */
.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-item:hover::after {
    opacity: 1;
}
.gallery-item:hover .gallery-label {
    opacity: 1;
    transform: translateY(0);
}
.gallery-label {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* CTA shimmer */
.cta-shimmer {
    position: relative;
    overflow: hidden;
}
.cta-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255,255,255,0.1) 50%,
        transparent 100%
    );
    transform: rotate(30deg);
    animation: shimmer 3s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}

/* Scrolled nav */
.nav-scrolled {
    background: rgba(255,255,255,0.97) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08) !important;
}

/* Mobile menu animation */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 72%;
    max-width: 320px;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 200;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -4px 0 25px rgba(0,0,0,0.15);
}
.mobile-menu.open {
    transform: translateX(0);
}
.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Diagonal section divider */
.diagonal-top {
    clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
}

@media (max-width: 767px) {
    .diagonal-top {
        clip-path: polygon(0 3%, 100% 0, 100% 100%, 0 100%);
    }
}

/* Parallax-like background movement */
.bg-fixed {
    background-attachment: fixed;
}
@supports (-webkit-touch-callout: none) {
    .bg-fixed {
        background-attachment: scroll;
    }
}

/* Lightbox styles */
.staldrew-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.staldrew-lightbox.active {
    opacity: 1;
    visibility: visible;
}
.staldrew-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 0.5rem;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.staldrew-lightbox.active img {
    opacity: 1;
    transform: scale(1);
}
.staldrew-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}
.staldrew-lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}
.staldrew-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}
.staldrew-lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}
.staldrew-lightbox-prev {
    left: 1.5rem;
}
.staldrew-lightbox-next {
    right: 1.5rem;
}
.staldrew-lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    z-index: 10;
}

/* ============================
   Product page styles
   ============================ */

/* Sidebar sticky */
.sidebar-sticky {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    z-index: 2;
}
.sidebar-link.active {
    color: #df8200;
    background: #fff7ed;
    border-left-color: #df8200;
}

/* Mobile sidebar toggle */
.sidebar-mobile {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-mobile.open { max-height: 500px; }

/* Full-bleed background for content sections */
.full-bleed-bg { position: relative; }
.full-bleed-bg::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: -100vw; right: -100vw;
    z-index: 0;
    background: inherit;
}
.full-bleed-bg > * { position: relative; z-index: 1; }

/* FAQ accordion */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.faq-answer.open { max-height: 300px; }
.faq-icon { transition: transform 0.3s ease; }
.faq-item.open .faq-icon { transform: rotate(180deg); }

/* Product page lightbox */
.lightbox {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox-img {
    max-height: 85vh;
    max-width: 90vw;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* ============================
   Blog / Wiedza
   ============================ */
.blog-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.10);
}
.cat-filter.active {
    background-color: #df8200;
    color: #fff;
    border-color: #df8200;
}
.sidebar-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-content.open {
    max-height: 600px;
}
.sidebar-toggle-icon {
    transition: transform 0.3s ease;
}
.sidebar-open .sidebar-toggle-icon {
    transform: rotate(180deg);
}

/* ============================
   Automatyka: comparison table
   ============================ */
.comparison-table .comparison-highlight-col {
    background: rgba(223, 130, 0, 0.05);
}
.comparison-table thead .comparison-highlight-col {
    background: rgba(255, 255, 255, 0.1);
}

/* Automatyka: price card highlight */
.price-card-highlight {
    border-color: #df8200;
    box-shadow: 0 0 0 1px #df8200, 0 4px 20px rgba(223, 130, 0, 0.15);
    position: relative;
}
.price-card-highlight::before {
    content: 'Najpopularniejszy';
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    background: #df8200;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: 9999px;
}

/* ============================
   Contact form messages + spinner
   ============================ */
.form-message {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-top: 0.5rem;
    transition: opacity 0.3s ease;
}
.form-message--success {
    background: #fff7ed;
    border: 1px solid #f97316;
    color: #9a3412;
}
.form-message--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}
.field-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}
.field-error:focus {
    ring-color: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
}
.field-error-msg {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}
.field-hint--error {
    color: #dc2626 !important;
}
/* Success modal */
.success-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}
.success-modal-overlay--visible {
    opacity: 1;
}
.success-modal {
    background: #fff;
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.success-modal-overlay--visible .success-modal {
    transform: scale(1);
}
.success-modal-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    color: #f97316;
}
.success-modal-icon svg {
    width: 100%;
    height: 100%;
}
.success-modal-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}
.success-modal-text {
    color: #64748b;
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}
.success-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f97316;
    color: #fff;
    font-weight: 700;
    padding: 0.75rem 2.5rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background 0.2s, transform 0.2s;
}
.success-modal-btn:hover {
    background: #ea580c;
    transform: scale(1.03);
}

.btn-loading {
    opacity: 0.7;
    pointer-events: none;
}
.btn-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
