/* =====================================================
   ROYAL DRINK - RESPONSIVE / MOBILE OPTIMIZATION
   ===================================================== */

/* Shared responsive safeguards */
:root {
    --mobile-nav-height: 74px;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.nav-open {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}

img,
video,
iframe,
svg {
    max-width: 100%;
}

.nav-backdrop {
    display: none;
}

.mobile-products-all {
    display: none;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

.table-scroll table {
    margin: 0;
}

/* Large desktop / small laptop */
@media (max-width: 1200px) {
    .container {
        max-width: 1120px;
    }

    .products-grid,
    .features-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-title {
        font-size: clamp(2.8rem, 5vw, 3.5rem);
    }
}

/* Off-canvas navigation breakpoint */
@media (max-width: 1180px) {
    .navbar,
    .navbar.scrolled {
        padding: 10px 0;
        min-height: var(--mobile-nav-height);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .navbar.menu-open {
        z-index: 10020;
    }

    .navbar > .container {
        overflow: visible;
    }

    .nav-content {
        min-height: 54px;
        gap: 14px;
    }

    .nav-logo {
        min-width: 0;
        flex: 1 1 auto;
        gap: 10px;
    }

    .nav-logo .logo-img {
        width: 112px;
        height: 58px;
        max-width: 112px;
        max-height: 58px;
        object-fit: contain;
        flex: 0 0 auto;
    }

    .nav-slogan {
        display: block;
        max-width: 155px;
        color: var(--primary);
        font-family: var(--font-heading);
        font-size: 0.66rem;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: 0.15px;
        white-space: normal;
    }

    .btn-shop {
        display: none;
    }

    .nav-actions {
        flex: 0 0 auto;
        gap: 0;
    }

    .nav-toggle {
        position: relative;
        z-index: 10031;
        display: inline-flex;
        width: 44px;
        height: 44px;
        padding: 9px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.05);
        -webkit-tap-highlight-color: transparent;
    }

    .nav-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        flex: 0 0 3px;
    }

    .nav-toggle.active {
        position: fixed;
        top: max(15px, env(safe-area-inset-top));
        right: max(16px, env(safe-area-inset-right));
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10000;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(4, 6, 18, 0.72);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }

    .nav-backdrop.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 10010;
        display: flex;
        width: min(88vw, 370px);
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        padding: calc(86px + env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom));
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: linear-gradient(180deg, #1a1a2e 0%, #121326 100%);
        border-left: 1px solid rgba(255, 215, 0, 0.18);
        box-shadow: -24px 0 60px rgba(0, 0, 0, 0.42);
        transform: translate3d(105%, 0, 0);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, visibility 0.3s ease;
    }

    .nav-menu::before {
        content: 'MENÜ';
        display: block;
        margin: 0 0 16px;
        padding: 0 4px 13px;
        color: rgba(255, 255, 255, 0.45);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-family: var(--font-heading);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 2px;
    }

    .nav-menu.active {
        transform: translate3d(0, 0, 0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-menu > li {
        display: block;
        width: 100%;
    }

    .nav-link {
        display: flex;
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        align-items: center;
        justify-content: space-between;
        color: rgba(255, 255, 255, 0.9);
        border: 1px solid transparent;
        border-radius: 11px;
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.35;
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--primary);
        background: rgba(255, 215, 0, 0.09);
        border-color: rgba(255, 215, 0, 0.13);
    }

    .nav-link::after {
        display: none;
    }

    .dropdown > .nav-link i {
        transition: transform 0.25s ease;
    }

    .dropdown.active > .nav-link i {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        display: grid;
        max-height: 0;
        min-width: 0;
        margin: 0;
        padding: 0 8px;
        gap: 2px;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: none;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
    }

    .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        transform: none;
    }

    .dropdown.active .dropdown-menu,
    .dropdown.active:hover .dropdown-menu {
        max-height: 360px;
        padding-top: 6px;
        padding-bottom: 8px;
        opacity: 1;
        visibility: visible;
    }

    .dropdown-menu li a {
        display: flex;
        min-height: 42px;
        padding: 10px 14px;
        align-items: center;
        color: rgba(255, 255, 255, 0.72);
        border-radius: 9px;
        font-size: 0.86rem;
    }

    .dropdown-menu li a:hover {
        padding-left: 14px;
        color: var(--primary);
        background: rgba(255, 255, 255, 0.05);
    }

    .mobile-products-all {
        display: block;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .about-grid,
    .form-grid,
    .mission-vision-grid,
    .featured-news-grid,
    .festival-featured-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 38px !important;
    }

    .blog-grid,
    .festivals-grid,
    .kampanyalar-grid,
    .contact-info-grid,
    .stats-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .how-to-grid,
    .benefits-grid,
    .other-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .festival-featured-image {
        min-height: 320px !important;
    }

    .page-header h1 {
        font-size: clamp(2rem, 5vw, 2.6rem);
    }

    .section-title,
    .about-content h2,
    .form-info h2,
    .cta-title {
        font-size: clamp(1.8rem, 4.4vw, 2.3rem);
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --mobile-nav-height: 72px;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    body {
        line-height: 1.65;
    }

    .top-bar {
        display: none;
    }

    .container {
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
        padding-inline: 18px;
        overflow: visible;
    }

    section {
        max-width: 100%;
        overflow-x: clip;
    }

    .navbar,
    .navbar.scrolled {
        position: sticky;
        top: 0;
        min-height: var(--mobile-nav-height);
        padding: 8px 0;
        background: #202035;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    }

    .nav-content {
        min-height: 56px;
    }

    .nav-logo {
        gap: 7px;
    }

    .nav-logo .logo-img {
        width: 102px;
        height: 54px;
        max-width: 102px !important;
        max-height: 54px;
    }

    .nav-logo:hover .logo-img {
        transform: none;
    }

    .nav-slogan {
        max-width: 128px;
        margin: 0;
        font-size: 0.58rem;
        line-height: 1.22;
    }

    .hero-section {
        width: 100%;
        height: calc(100svh - var(--mobile-nav-height));
        min-height: 620px;
        max-height: 860px;
        padding: 0;
        overflow: hidden;
        align-items: center;
        justify-content: center;
        background: var(--secondary);
    }

    .hero-video-wrapper,
    .hero-video-wrapper video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .hero-video-wrapper video {
        display: block;
        max-width: none;
        object-fit: cover;
        object-position: 50% 50%;
    }

    .hero-overlay {
        background: linear-gradient(
            180deg,
            rgba(16, 17, 35, 0.12) 0%,
            rgba(16, 17, 35, 0.2) 38%,
            rgba(16, 17, 35, 0.66) 72%,
            rgba(16, 17, 35, 0.92) 100%
        );
    }

    .hero-content {
        width: 100%;
        max-width: 460px;
        padding: 110px 20px 18px;
        transform: translateY(4vh);
    }

    .hero-badge {
        max-width: 100%;
        margin-bottom: 15px;
        padding: 7px 15px;
        font-size: clamp(0.68rem, 3vw, 0.78rem);
        line-height: 1.35;
        white-space: normal;
    }

    .hero-title {
        margin-bottom: 14px;
        font-size: clamp(1.9rem, 8.2vw, 2.45rem);
        line-height: 1.12;
    }

    .hero-subtitle {
        max-width: 390px;
        margin: 0 auto 24px;
        font-size: clamp(0.9rem, 3.7vw, 1rem);
        line-height: 1.65;
    }

    .hero-buttons {
        width: 100%;
        max-width: 300px;
        margin-inline: auto;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .hero-buttons .btn {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }

    .hero-scroll {
        display: none;
    }

    .section,
    .form-section {
        padding: 58px 0;
    }

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

    .section-title,
    .about-content h2,
    .form-info h2,
    .cta-title {
        font-size: clamp(1.55rem, 7vw, 2rem);
        line-height: 1.25;
    }

    .section-subtitle,
    .about-content p,
    .form-info p,
    .cta-text {
        font-size: 0.94rem;
    }

    .section-badge {
        padding: 6px 15px;
        font-size: 0.72rem;
    }

    .products-grid,
    .features-grid,
    .blog-grid,
    .kampanyalar-grid,
    .festivals-grid,
    .how-to-grid,
    .benefits-grid,
    .other-products-grid,
    .contact-info-grid,
    .stats-grid-4,
    .mission-vision-grid,
    .featured-news-grid,
    .about-grid,
    .form-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 22px !important;
        width: 100%;
        max-width: 100%;
    }

    .products-grid,
    .features-grid,
    .blog-grid,
    .other-products-grid {
        max-width: 430px;
        margin-inline: auto;
    }

    .product-card,
    .feature-card,
    .blog-card,
    .campaign-card,
    .contact-form {
        width: 100%;
        max-width: 100%;
    }

    .product-card-img {
        height: 240px;
        padding: 14px;
    }

    .product-card-body,
    .blog-card-body {
        padding: 22px 18px;
    }

    .feature-card {
        padding: 30px 20px;
    }

    .feature-icon {
        width: 68px;
        height: 68px;
        margin-bottom: 16px;
        font-size: 1.65rem;
    }

    .about-image {
        width: 100%;
    }

    .about-image::before {
        display: none;
    }

    .about-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .stat-item {
        min-width: 0;
        padding: 15px 7px;
    }

    .stat-number {
        font-size: 1.45rem;
    }

    .stat-label {
        font-size: 0.72rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .blog-card-meta {
        flex-wrap: wrap;
        gap: 7px 12px;
    }

    .campaign-card {
        height: 390px;
        min-height: 390px;
    }

    .campaign-overlay {
        padding: 22px 18px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.58) 62%, transparent 100%);
    }

    .campaign-title {
        font-size: 1.18rem;
    }

    .campaign-desc {
        display: -webkit-box;
        overflow: hidden;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
    }

    .festival-featured-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        min-height: 0 !important;
    }

    .festival-featured-content {
        padding: 28px 22px !important;
    }

    .festival-featured-title {
        font-size: 1.55rem !important;
    }

    .festival-featured-image {
        min-height: 260px !important;
        height: 260px !important;
    }

    .festival-featured-image > div {
        background: linear-gradient(to bottom, rgba(26, 26, 46, 0.08), rgba(26, 26, 46, 0.78)) !important;
    }

    .festival-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .festival-gallery-item {
        height: 145px !important;
    }

    .form-grid {
        align-items: stretch;
    }

    .contact-form,
    form[style*="background: #fff"] {
        padding: 24px 18px !important;
    }

    .form-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .form-control,
    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    .form-control {
        min-height: 48px;
        padding: 12px 14px;
    }

    textarea.form-control {
        min-height: 120px;
    }

    .btn,
    .btn-submit,
    .product-card-btn,
    .filter-btn {
        min-height: 46px;
        touch-action: manipulation;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.84rem;
    }

    .filter-btn {
        padding: 9px 16px !important;
        margin: 4px 2px !important;
        font-size: 0.82rem !important;
    }

    .page-header {
        padding: 68px 18px 40px;
    }

    .page-header h1 {
        margin-inline: auto;
        font-size: clamp(1.7rem, 7.6vw, 2.15rem);
        line-height: 1.22;
    }

    .page-header p {
        font-size: 0.9rem;
        line-height: 1.55;
    }

    .breadcrumb {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        font-size: 0.82rem;
    }

    .cta-section {
        padding: 58px 0;
    }

    .footer-main {
        padding: 58px 0 30px;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 34px;
        text-align: center;
    }

    .footer-logo img {
        width: 190px;
        height: auto;
        max-height: none;
        margin: 0 auto 18px;
        object-fit: contain;
    }

    .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-social,
    .footer-links a,
    .footer-contact li {
        justify-content: center;
    }

    .footer-bottom-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-bottom-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 15px;
    }

    .footer-bottom-links a {
        margin: 0;
    }

    .newsletter-form,
    .blog-newsletter-form {
        width: 100%;
        max-width: 430px !important;
    }

    .blog-newsletter-form {
        flex-direction: column;
        gap: 10px;
        overflow: visible !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .blog-newsletter-form input,
    .blog-newsletter-form button {
        width: 100%;
        min-height: 50px;
        border-radius: 28px;
    }

    .newsletter-form input {
        min-width: 0;
    }

    .whatsapp-btn {
        left: max(16px, env(safe-area-inset-left));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: 50px;
        height: 50px;
        font-size: 1.35rem;
    }

    .back-to-top {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
        width: 46px;
        height: 46px;
    }

    table {
        width: max-content !important;
        min-width: 620px;
        max-width: none !important;
    }

    div[style*="overflow-x: auto"] {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    iframe {
        width: 100%;
        min-height: 300px;
    }

    .marquee-content {
        font-size: 0.76rem !important;
        letter-spacing: 1px !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .container {
        padding-inline: 15px;
    }

    .nav-logo .logo-img {
        width: 94px;
        height: 50px;
        max-width: 94px !important;
        max-height: 50px;
    }

    .nav-slogan {
        max-width: 104px;
        font-size: 0.53rem;
    }

    .nav-menu {
        width: min(92vw, 350px);
        padding-inline: 18px;
    }

    .hero-section {
        min-height: 590px;
    }

    .hero-content {
        padding-inline: 16px;
        padding-top: 92px;
        transform: translateY(3vh);
    }

    .hero-buttons {
        max-width: 280px;
    }

    .about-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat-item {
        padding: 15px;
    }

    .festival-gallery-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .festival-gallery-item {
        height: 190px !important;
    }

    .campaign-card {
        height: 410px;
        min-height: 410px;
    }

    .newsletter-form {
        flex-direction: column;
        gap: 10px;
        border: 0;
        overflow: visible;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        min-height: 48px;
        border-radius: 24px;
    }
}

/* Short landscape phones */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 520px) {
    .hero-section {
        height: auto;
        min-height: 520px;
        max-height: none;
        padding: 56px 0 42px;
    }

    .hero-content {
        padding-top: 20px;
        transform: none;
    }

    .hero-buttons {
        max-width: 600px;
        flex-direction: row;
    }

    .hero-buttons .btn {
        width: auto;
        flex: 1 1 220px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print */
@media print {
    .navbar,
    .top-bar,
    .footer,
    .back-to-top,
    .whatsapp-btn,
    #preloader,
    .nav-backdrop {
        display: none !important;
    }

    .hero-section {
        height: auto;
        min-height: 0;
        padding: 40px 0;
    }

    .hero-video-wrapper {
        display: none;
    }
}
