/* ============================================
   CONTACT PAGE - PROFESSIONAL RESPONSIVE CSS
   FIXED: iPads & Tablets (5th card visible)
   ============================================ */

/* ========== TABLETS & iPADS (PORTRAIT) ========== */
/* Devices: 768px - 1024px (iPads, Galaxy Tabs) */
@media screen and (max-width: 1024px) and (min-width: 768px) {
    .container {
        padding: 0 32px;
    }

    .hero-section {
        min-height: 550px;
    }

    .hero-content {
        max-width: 480px;
        margin-left: 32px;
    }

    .hero-content h1 {
        font-size: 48px;
    }

    .hero-content p {
        font-size: 17px;
        max-width: 460px;
    }

    .cards-panel {
        padding: 36px 32px;
    }

    /* ===== تنسيق بطاقات التواصل في الآيباد ===== */
    /* 3 بطاقات في الصف الأول + 2 بطاقات في الصف الثاني */
    .contact-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 16px;
    }

    /* أول 3 بطاقات (WhatsApp, WeChat, Email) - كل بطاقة تأخذ عمودين */
    .contact-card:nth-child(1),
    .contact-card:nth-child(2),
    .contact-card:nth-child(3) {
        grid-column: span 2;
    }

    /* البطاقة الرابعة (Follow Us) - تأخذ 3 أعمدة */
    .contact-card:nth-child(4) {
        grid-column: span 3;
    }

    /* البطاقة الخامسة (Working Hours) - تأخذ 3 أعمدة */
    .contact-card:nth-child(5) {
        grid-column: span 3;
    }

    .contact-card {
        border: 1px solid var(--line);
        border-radius: 20px;
        padding: 24px 16px;
        background: white;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    }

    .card-icon,
    .working-clock {
        width: 65px;
        height: 65px;
        font-size: 30px;
        margin-bottom: 14px;
    }

    .contact-card h3 {
        font-size: 18px;
        margin-bottom: 8px;
        font-weight: 800;
    }

    .contact-card p {
        font-size: 13px;
        line-height: 1.45;
        color: var(--muted);
    }

    .small-btn {
        padding: 10px 14px;
        font-size: 12px;
        margin-top: 12px;
        border-radius: 30px;
        display: inline-block;
        max-width: 100%;
        word-break: break-word;
        white-space: normal;
        text-align: center;
    }

    /* زر البريد الإلكتروني في الآيباد */
    .email-btn {
        word-break: break-all;
        white-space: normal;
        font-size: 11px;
        padding: 8px 12px;
    }

    .social-row {
        margin-top: 12px;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .social-row a {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .follow-card,
    .hours-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .form-map-grid {
        gap: 24px;
    }

    .form-card,
    .map-card {
        padding: 28px;
    }

    .office-info div {
        grid-template-columns: 40px 1fr;
        gap: 12px;
    }

    .office-info i {
        width: 40px;
        height: 40px;
    }

    .faq-card {
        padding: 28px;
    }

    .faq-item button {
        font-size: 15px;
        padding: 14px 18px;
    }
}

/* ========== LARGE TABLETS (iPad Pro 12.9", Surface Pro) ========== */
/* Devices: 1025px - 1280px */
@media screen and (max-width: 1280px) and (min-width: 1025px) {
    .container {
        max-width: 1200px;
        padding: 0 32px;
    }

    .hero-content h1 {
        font-size: 58px;
    }

    .contact-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }

    .contact-card {
        min-height: auto;
        padding: 20px 12px;
        border: 1px solid var(--line);
        border-radius: 18px;
    }

    .contact-card p {
        font-size: 13px;
    }

    .small-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ========== MOBILES (MAIN RESPONSIVE) ========== */
@media screen and (max-width: 767px) {
    .container {
        width: 100%;
        padding: 0 16px;
    }

    .hero-section {
        min-height: 480px;
        border-radius: 0 0 20px 20px;
    }

    .hero-bg {
        background-position: 65% center;
    }

    .hero-overlay {
        background: linear-gradient(90deg,
                rgba(255, 255, 255, .98) 0%,
                rgba(255, 255, 255, .94) 45%,
                rgba(255, 255, 255, .8) 70%,
                rgba(255, 255, 255, .4) 100%);
    }

    .hero-content {
        max-width: 100%;
        margin-left: 0;
        padding: 0 16px;
        text-align: left;
    }

    .hero-content h1 {
        font-size: 42px;
        letter-spacing: -0.05em;
        line-height: 1.15;
    }

    .hero-content p {
        font-size: 16px;
        line-height: 1.65;
        margin-top: 16px;
    }

    .hero-btn {
        padding: 16px 28px;
        font-size: 15px;
        margin-top: 28px;
    }

    .cards-panel {
        padding: 28px 20px;
    }

    .section-title h2 {
        font-size: 30px;
        line-height: 1.3;
        word-wrap: break-word;
        white-space: normal;
    }

    .section-title p {
        font-size: 15px;
    }

    /* ===== تنسيق بطاقات التواصل للجوال ===== */
    .contact-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 14px;
    }

    .contact-card:nth-child(1),
    .contact-card:nth-child(2),
    .contact-card:nth-child(3) {
        grid-column: span 2;
    }

    .contact-card:nth-child(4) {
        grid-column: span 3;
    }

    .contact-card:nth-child(5) {
        grid-column: span 3;
    }

    .contact-card {
        border: 1px solid var(--line);
        border-radius: 20px;
        min-height: auto;
        padding: 20px 12px;
        background: white;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    }

    .card-icon,
    .working-clock {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 14px;
    }

    .contact-card h3 {
        font-size: 17px;
        margin-bottom: 8px;
        font-weight: 800;
    }

    .contact-card p {
        font-size: 12px;
        line-height: 1.45;
        color: var(--muted);
    }

    .small-btn {
        padding: 9px 12px;
        font-size: 11px;
        min-height: auto;
        margin-top: 12px;
        border-radius: 30px;
        font-weight: 700;
        display: inline-block;
        max-width: 100%;
        word-break: break-all;
        white-space: normal;
        line-height: 1.4;
        text-align: center;
    }

    .email-btn {
        word-break: break-all;
        white-space: normal;
        overflow-wrap: break-word;
        hyphens: auto;
        font-size: 10px;
        padding: 8px 10px;
    }

    .whatsapp-btn,
    .wechat-btn {
        white-space: nowrap;
    }

    .social-row {
        margin-top: 12px;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .social-row a {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .follow-card,
    .hours-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .form-map-section {
        padding-top: 40px;
    }

    .form-map-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .form-card,
    .map-card {
        padding: 24px 20px;
        border-radius: 24px;
    }

    form {
        gap: 16px;
    }

    .input-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }

    input,
    textarea {
        padding: 15px 16px 15px 46px;
        font-size: 15px;
        border-radius: 14px;
    }

    label i {
        left: 17px;
        font-size: 15px;
    }

    textarea {
        min-height: 130px;
    }

    button[type="submit"] {
        padding: 17px;
        font-size: 16px;
        border-radius: 14px;
        font-weight: 800;
    }

    .map-box img {
        height: 190px;
    }

    .office-info {
        padding: 20px;
        gap: 16px;
    }

    .office-info div {
        display: grid;
        grid-template-columns: 42px 1fr;
        gap: 12px;
        align-items: start;
    }

    .office-info i {
        width: 42px;
        height: 42px;
        font-size: 17px;
    }

    .office-info strong {
        font-size: 14px;
        margin-bottom: 3px;
        display: block;
    }

    .office-info span {
        font-size: 13px;
        line-height: 1.45;
        word-break: break-word;
    }

    .faq-section {
        padding: 40px 0 60px;
    }

    .faq-card {
        padding: 24px 20px;
        border-radius: 24px;
    }

    .faq-list {
        gap: 12px;
    }

    .faq-item {
        border-radius: 18px;
    }

    .faq-item button {
        min-height: 64px;
        padding: 15px 18px;
        font-size: 15px;
        font-weight: 800;
        gap: 12px;
        line-height: 1.4;
        text-align: left;
        word-break: break-word;
    }

    .faq-item button i {
        width: 34px;
        height: 34px;
        font-size: 13px;
        flex-shrink: 0;
    }

    .faq-answer p {
        padding: 6px 18px 20px 18px;
        font-size: 14px;
        line-height: 1.65;
        word-break: break-word;
    }

    .wechat-popup {
        padding: 20px;
    }

    .wechat-popup-box {
        padding: 30px 22px;
        border-radius: 28px;
    }

    .wechat-close {
        right: 14px;
        top: 14px;
        width: 36px;
        height: 36px;
    }

    .wechat-popup-box h3 {
        font-size: 23px;
    }

    .wechat-popup-box p {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .wechat-qr-image {
        width: 210px;
        height: 240px;
    }

    .reveal {
        transform: translateY(24px);
    }
}

/* ========== SMALL MOBILES (iPhone SE, 375px and below) ========== */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .hero-section {
        min-height: 430px;
    }

    .hero-content h1 {
        font-size: 34px;
    }

    .hero-content p {
        font-size: 14px;
    }

    .hero-btn {
        padding: 13px 22px;
        font-size: 14px;
    }

    .cards-panel {
        padding: 22px 14px;
    }

    .section-title h2 {
        font-size: 26px;
    }

    .contact-grid {
        gap: 10px;
    }

    .contact-card {
        padding: 16px 8px;
    }

    .card-icon,
    .working-clock {
        width: 52px;
        height: 52px;
        font-size: 24px;
        margin-bottom: 10px;
    }

    .contact-card h3 {
        font-size: 15px;
    }

    .contact-card p {
        font-size: 11px;
    }

    .small-btn {
        padding: 7px 8px;
        font-size: 10px;
    }

    .email-btn {
        font-size: 9px;
        padding: 6px 8px;
        word-break: break-all;
    }

    .whatsapp-btn,
    .wechat-btn {
        font-size: 10px;
        white-space: nowrap;
        padding: 7px 10px;
    }

    .social-row a {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .form-card,
    .map-card {
        padding: 20px 16px;
    }

    input,
    textarea {
        padding: 13px 14px 13px 42px;
        font-size: 14px;
    }

    .faq-item button {
        min-height: 58px;
        font-size: 14px;
        padding: 12px 14px;
    }

    .faq-item button i {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .faq-answer p {
        font-size: 13px;
        padding: 6px 14px 16px 14px;
    }
}

/* ========== EXTRA SMALL (Galaxy Fold, 320px) ========== */
@media screen and (max-width: 374px) {
    .contact-card {
        padding: 12px 6px;
    }

    .card-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .contact-card h3 {
        font-size: 13px;
    }

    .email-btn {
        font-size: 8px;
        padding: 5px 6px;
    }

    .whatsapp-btn,
    .wechat-btn {
        font-size: 9px;
        padding: 5px 8px;
    }
}

/* ========== LANDSCAPE MODE ========== */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 350px;
    }

    .hero-content h1 {
        font-size: 30px;
    }

    .hero-content p {
        font-size: 13px;
    }

    .contact-card {
        padding: 12px 8px;
    }
}

/* ========== TOUCH FRIENDLY ========== */
@media (hover: none) and (pointer: coarse) {

    .hero-btn:hover,
    .small-btn:hover,
    button[type="submit"]:hover {
        transform: none;
    }

    .hero-btn:active,
    .small-btn:active,
    button[type="submit"]:active {
        transform: scale(0.97);
    }
}

/* ========== RETINA SCREENS ========== */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .hero-bg {
        background-image: url("image/hero-office.png");
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: translateY(0);
    }
}