/* 
   «Скала» - Магазин натуральных материалов
   Design System & Main Styles
*/

:root {
    /* Colors from TZ2.txt */
    --color-bg: #F6F3EF;
    /* Light stone */
    --color-text-main: #1E2328;
    /* Graphite */
    --color-text-secondary: #5B6570;
    /* Stone grey */
    --color-accent: #2E5B73;
    /* Slate blue / Steel */
    --color-accent-hover: #3a728f;
    --color-extra: #B46A3C;
    /* Terracotta / Copper */
    --color-border: #E6E0DA;
    /* Light grey border */
    --color-white: #FFFFFF;

    /* Spacing & Layout */
    --container-max-width: 1450px;
    --section-padding: 100px 20px;
    --section-padding-mobile: 60px 0px;

    /* UI Style */
    --radius-button: 14px;
    --radius-card: 18px;
    --transition-base: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

.no-scroll {
    overflow: hidden !important;
    height: 100% !important;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    transition: var(--transition-base);
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 900;
    line-height: 1.2;
    text-align: left;
}

h1 {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: clamp(40px, 5vw, 72px);
    margin-bottom: 24px;
    letter-spacing: -1.5px;
}

h2 {
    font-size: clamp(32px, 4vw, 48px);
    margin-bottom: 40px;
}

h3 {
    font-size: 24px;
    margin-bottom: 16px;
}

.text-secondary {
    color: var(--color-text-secondary);
}

/* Layout */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: var(--section-padding);
}

/* Form Elements */
input,
textarea {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    background: var(--color-white);
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    transition: var(--transition-base);
}

input:focus,
textarea:focus {
    border-color: var(--color-accent);
    outline: none;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 36px;
    border-radius: var(--radius-button);
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    gap: 12px;
}

.section-header {
    margin-bottom: 30px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-hover));
    color: var(--color-white);
    border: none;
    /* Make sure no solid border overrides it */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(46, 91, 115, 0.3);
    /* Gradient can just shift or we can rely on opacity/shadow since animating background gradient is tricky without pseudo elements, but transform is enough */
}

.btn-secondary {
    border: 1px solid var(--color-border);
    background: transparent;
}

.btn-secondary:hover {
    background-color: var(--color-white);
    border-color: var(--color-accent);
}

/* Animation Classes (IntersectionObserver) */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }

    .container {
        padding: 0 20px;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 35, 40, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--color-bg);
    border-radius: var(--radius-card);
    width: 100%;
    max-width: 1000px;
    /* larger modal width for images */
    max-height: 90vh;
    /* changed from max-height:90vh to avoid content cutoff */
    height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    overflow-y: auto;
    scrollbar-width: none;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    z-index: 10;
}

.modal-body {
    padding: 40px;
}

.modal-desc {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.modal-gallery img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .modal-body {
        padding: 20px;
    }

    .form-container h2 {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .form-subtitle {
        margin-bottom: 20px;
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        margin-bottom: 4px;
    }

    .form-group input,
    .form-group textarea {
        padding: 12px 16px;
    }

    .form-group textarea {
        height: 100px;
    }

    .btn-block {
        margin-bottom: 16px;
        padding: 16px;
    }

    .modal-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .modal-gallery {
        grid-template-columns: 1fr;
    }
}

/* Price Quote Modal & Form Styles */
.modal-form-content {
    max-width: 600px;
    background: #F8F5F1;
    /* matches the screenshot's warm off-white */
}

.form-container {
    text-align: center;
}

.form-container h2 {
    font-size: 36px;
    margin-bottom: 16px;
    text-align: center;
}

.form-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 40px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 16px;
}

.form-group textarea {
    height: 120px;
    resize: none;
}

.btn-block {
    width: 100%;
    margin-bottom: 24px;
    background: var(--color-text-main);
    /* darker button as per screenshot */
}

.btn-block:hover {
    background: #101316;
}

.form-privacy {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-align: left;
    font-size: 12px;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.form-privacy input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
}

.form-privacy a {
    text-decoration: underline;
}

/* Success Message */
.form-success-msg {
    padding: 40px 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: var(--color-accent);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 24px;
}

.form-success-msg h3 {
    text-align: center;
    margin-bottom: 12px;
}

.form-success-msg p {
    margin-bottom: 30px;
}