/**
 * custom.css – Component overrides and additional styles
 *
 * These styles supplement style.css with any extra component-level
 * tweaks and browser-specific fixes.
 *
 * @package AutohausLeopoldau21
 * @since 1.0.0
 */

/* ============================================================
   SWIPER OVERRIDES
   ============================================================ */

/* Ensure thumbs swiper doesn't overflow */
.swiper-thumbs {
    padding: 6px !important;
}

.swiper-thumbs .swiper-slide {
    width: auto;
    flex-shrink: 0;
    height: 72px;
    cursor: pointer;
}

.swiper-thumbs .swiper-slide img {
    height: 100%;
    width: auto;
    object-fit: cover;
    border-radius: 4px;
    pointer-events: none;
}

/* Gallery navigation buttons refinement */
#swiperMain .swiper-button-next,
#swiperMain .swiper-button-prev {
    opacity: 0;
    transition: opacity 0.2s ease;
}

#swiperMain:hover .swiper-button-next,
#swiperMain:hover .swiper-button-prev,
#swiperMain:focus-within .swiper-button-next,
#swiperMain:focus-within .swiper-button-prev {
    opacity: 1;
}

/* Related cars swiper */
.swiper-related .swiper-slide {
    height: auto;
}

.swiper-related .swiper-pagination {
    position: static;
    margin-top: 1.5rem;
}

/* ============================================================
   WORDPRESS ADMIN BAR COMPATIBILITY
   ============================================================ */
@media screen and (max-width: 782px) {
    body.admin-bar {
        padding-top: 46px;
    }

    body.admin-bar .site-header {
        top: 46px;
    }

    body.admin-bar .mobile-menu {
        top: 0;
        padding-top: calc(var(--header-height) + 46px + var(--spacing-6));
    }
}

/* ============================================================
   WORDPRESS CORE ALIGNMENT CLASSES
   ============================================================ */
.alignleft  { float: left;  margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 0 auto 1rem; }
.alignfull  { width: 100%; }

/* ============================================================
   ENTRY CONTENT: WordPress default styles
   ============================================================ */
.entry-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(180, 22, 23, 0.3);
}

.entry-content a:hover {
    text-decoration-color: var(--color-primary);
}

.entry-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--color-gray-50);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--color-gray-600);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.entry-content table th,
.entry-content table td {
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-gray-200);
    text-align: left;
}

.entry-content table th {
    background: var(--color-gray-100);
    font-weight: 700;
}

/* ============================================================
   ARCHIVE TOOLBAR – sort select width
   ============================================================ */
.sort-select {
    min-width: 160px;
}

/* ============================================================
   CUSTOM SCROLLBAR (webkit)
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

/* ============================================================
   FORM VALIDATION STATES
   ============================================================ */
.form-control:invalid:not(:placeholder-shown) {
    border-color: var(--color-error);
}

.form-control:valid:not(:placeholder-shown) {
    border-color: var(--color-success);
}

/* ============================================================
   LOADING SKELETON (for cars grid placeholder)
   ============================================================ */
@keyframes skeleton-loading {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #f3f4f6 25%, #e9eaec 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius);
}

/* ============================================================
   PRINT REFINEMENTS
   ============================================================ */
@media print {
    .single-car-sidebar,
    .related-cars-section,
    .share-section,
    .lightbox-overlay,
    .cta-banner {
        display: none !important;
    }

    .single-car-layout {
        grid-template-columns: 1fr;
    }

    .car-gallery-section {
        page-break-inside: avoid;
    }

    .specs-card,
    .equipment-card,
    .description-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ============================================================
   HIGH CONTRAST / REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================================
   SECTION PADDING FINE-TUNING AT BREAKPOINTS
   ============================================================ */
@media (max-width: 639px) {
    .section {
        padding: var(--spacing-12) 0;
    }

    .hero-stats {
        gap: var(--spacing-6);
    }

    .about-image-badge {
        bottom: var(--spacing-3);
        right: var(--spacing-3);
        padding: var(--spacing-3) var(--spacing-4);
    }

    .about-image-badge .number {
        font-size: var(--font-size-2xl);
    }

    .price-card-amount {
        font-size: var(--font-size-4xl);
    }

    .single-car-title {
        font-size: 1.75rem;
    }

    .cta-banner-title {
        font-size: var(--font-size-2xl);
    }
}
