/* Custom CSS for Кам'яний двір */

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Fix select dropdown z-index */
select {
    position: relative;
    z-index: 100;
}

select option {
    padding: 8px 12px;
    cursor: pointer;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f5f5f4;
}

::-webkit-scrollbar-thumb {
    background: #78716c;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #57534e;
}

/* Line clamp utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active,
#mobile-menu:not(.hidden) {
    max-height: 600px;
}

/* Floating action buttons (quick contact, back to top) */
:root {
    --floating-bottom: 1.25rem;
    --header-height: 7.5rem;
}

.sticky-below-header {
    position: sticky;
    top: var(--header-height, 7.5rem);
    z-index: 10;
}

body.has-cookie-banner {
    --floating-bottom: 5.75rem;
}

.floating-action {
    position: fixed;
    bottom: var(--floating-bottom);
    z-index: 40;
    transition: bottom 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.floating-action-right {
    right: 1.25rem;
}

.floating-action-left {
    left: 1.25rem;
    width: 3rem;
    height: 3rem;
    background-color: #78716c;
    color: white;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-action-left:hover {
    background-color: #57534e;
}

@media (min-width: 768px) {
    .floating-action-left {
        left: auto;
        right: 1.25rem;
        bottom: calc(var(--floating-bottom) + 4.5rem);
        background-color: #9a855f;
    }

    .floating-action-left:hover {
        background-color: #7a6a4d;
    }

    body.has-cookie-banner .floating-action-left {
        bottom: calc(var(--floating-bottom) + 4.5rem);
    }
}

/* Image lazy loading placeholder */
img[loading="lazy"] {
    background-color: #f5f5f4;
}

/* Button hover effects */
.btn-hover {
    transition: all 0.3s ease;
}

.btn-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Input focus styles */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(154, 133, 95, 0.2);
}

/* Loading spinner */
.spinner {
    border: 3px solid #f5f5f4;
    border-top: 3px solid #9a855f;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background-color: #22c55e;
}

.toast.error {
    background-color: #ef4444;
}

.toast.info {
    background-color: #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Gallery image zoom */
.gallery-img {
    transition: transform 0.3s ease;
}

.gallery-img:hover {
    transform: scale(1.05);
}

/* Price animation */
.price-animate {
    animation: priceHighlight 0.5s ease;
}

@keyframes priceHighlight {
    0%, 100% { color: #9a855f; }
    50% { color: #7a6a4d; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* Print styles */
@media print {
    header,
    footer,
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #9a855f;
    outline-offset: 2px;
}
