/* common.css - Typography, Utilities, Containers, Forms, Buttons */

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: #444;
}

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

.tamil-text {
    font-family: var(--font-tamil);
}

/* Containers */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
    color: var(--primary-color);
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
}

/* Grid System */
.grid {
    display: grid;
    gap: 30px;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    min-width: 0;
}

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

.btn-primary:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

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

.btn-secondary:hover {
    background-color: transparent;
    color: var(--secondary-color);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.glass-dark {
    background: rgba(28, 28, 28, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* Sticky CTA */
.sticky-cta {
    position: fixed;
    bottom: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: calc(100vw - 24px);
}

.sticky-cta.left { left: 30px; }
.sticky-cta.right { right: 28px; }

/* Hide the whatsapp cta-btn (replaced by wa-floating-btn widget) */
.sticky-cta .whatsapp {
    display: none !important;
}

.cta-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 22px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    flex: 0 0 auto;
}

.back-to-top {
    position: fixed;
    bottom: 92px;
    right: 34px;
    width: 40px;
    height: 40px;
    background-color: var(--secondary-color);
    color: var(--dark-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    text-decoration: none;
    z-index: 99;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.back-to-top:hover,
.back-to-top:focus-visible {
    transform: translateY(-3px);
    background-color: var(--accent-color);
}

.cta-btn.call {
    background: linear-gradient(135deg, #b71c1c, var(--primary-color));
    box-shadow: 0 6px 20px rgba(123, 17, 19, 0.45);
    animation: call-pulse 2.2s infinite;
}

.cta-btn.call:hover {
    transform: scale(1.12);
    box-shadow: 0 10px 28px rgba(123, 17, 19, 0.55);
}

@keyframes call-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(123, 17, 19, 0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(123, 17, 19, 0); }
    100% { box-shadow: 0 0 0 0 rgba(123, 17, 19, 0); }
}

/* On desktop (>=992px) nav already shows call CTA — keep button but smaller */
@media (min-width: 992px) {
    .cta-btn.call {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sticky-cta.right {
        right: max(14px, env(safe-area-inset-right));
        bottom: max(18px, env(safe-area-inset-bottom));
    }
    .cta-btn {
        width: 52px;
        height: 52px;
        font-size: 21px;
    }

    .back-to-top {
        right: max(20px, env(safe-area-inset-right));
        bottom: calc(max(18px, env(safe-area-inset-bottom)) + 66px);
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 480px) {
    .sticky-cta.right {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
    }

    .btn {
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
}
