/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f39c12;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white-color: #ffffff;
    --text-dark: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Arabic RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

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

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* ===== NAVIGATION ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3c72 100%) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    transition: var(--transition);
    padding: 1rem 0;
    z-index: 1030;
    min-height: 70px;
}

.navbar-brand {
    font-weight: 700;
    color: var(--white-color) !important;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--white-color) !important;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.language-toggle .btn {
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
}

.language-toggle .btn:hover {
    transform: scale(1.05);
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.hero-slide {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 2rem 0;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3c72 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #16a085 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
}

.hero-image {
    position: relative;
    text-align: center;
    margin-top: 2rem;
}

.hero-image img {
    max-width: min(400px, 80vw);
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
}

/* Floating Animation */
@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

/* Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
    width: clamp(40px, 8vw, 60px);
    height: clamp(40px, 8vw, 60px);
    opacity: 0.8;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    margin: auto 1rem;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
}

.carousel-indicators {
    bottom: 20px;
}

.carousel-indicators button {
    width: clamp(8px, 2vw, 12px);
    height: clamp(8px, 2vw, 12px);
    border-radius: 50%;
    margin: 0 5px;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3c72 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e67e22 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #16a085 100%);
}

/* ===== SECTIONS ===== */
section {
    padding: clamp(40px, 8vw, 80px) 0;
}

.section-title {
    position: relative;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 2px;
}

/* ===== ABOUT SECTION ===== */
.factory-info {
    background: var(--light-color);
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.map-container {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: clamp(300px, 60vh, 400px);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== PRODUCTS SECTION ===== */
.product-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--white-color);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.product-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white-color);
    padding: clamp(1rem, 3vw, 2rem) 1rem 1rem;
    transform: translateY(0%);
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    transform: translateY(0);
}

.product-overlay h5 {
    margin: 0;
    font-weight: 600;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}
.product-overlay span {
    margin: 0;
    font-weight: 200;
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
}

/* ===== CONTACT SECTION ===== */
.contact-info {
    background: var(--light-color);
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: 100%;
}

.contact-item {
    padding: clamp(0.8rem, 2vw, 1rem);
    border-radius: var(--border-radius);
    background: var(--white-color);
    transition: var(--transition);
    margin-bottom: 1rem;
}

.contact-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow);
}

.contact-form {
    background: var(--white-color);
    padding: clamp(1.5rem, 4vw, 2rem);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: 100%;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a252f 100%);
    color: var(--white-color);
    padding: clamp(2rem, 5vw, 3rem) 0;
}

footer h5 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

footer .social-links a {
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0 0.5rem;
}

footer .social-links a:hover {
    background-color: var(--primary-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Snack Animations ===== */
.snack-animations {
    pointer-events: none;
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
}

/* ===== Chips Game Section ===== */
#chips-game {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e3c72 100%);
    position: relative;
    overflow: hidden;
}

.game-container {
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-canvas-container {
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#chipsGameCanvas {
    display: block;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    cursor: crosshair;
}

.game-controls h4 {
    color: var(--white-color);
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.score-display, .best-score, .controls-info, .objective {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.score-display span, .best-score span {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#gameOverlay {
    backdrop-filter: blur(5px);
    z-index: 1000;
}

#gameOverlay h3 {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    font-weight: 700;
}

/* Game Button Styles */
#startGame, #pauseGame, #restartGame {
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#startGame:hover, #pauseGame:hover, #restartGame:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Responsive Game Design */
@media (max-width: 991.98px) {
    .game-canvas-container {
        height: 300px !important;
    }
    
    #chipsGameCanvas {
        width: 100% !important;
        height: 100% !important;
    }
}

@media (max-width: 767.98px) {
    .game-canvas-container {
        height: 250px !important;
    }
    
    .game-controls {
        margin-top: 2rem;
    }
    
    .score-display span {
        font-size: 2rem !important;
    }
    
    .best-score span {
        font-size: 1.5rem !important;
    }
}

.popcorn, .chips {
    position: absolute;
    width: clamp(40px, 8vw, 60px);
    opacity: 0.85;
    z-index: 2;
    pointer-events: none;
}

.popcorn-1 {
    left: 10%; top: 10%;
    animation: popcorn-float 6s infinite ease-in-out;
}
.popcorn-2 {
    left: 80%; top: 25%;
    animation: popcorn-float 7s 2s infinite ease-in-out;
}

.chips-1 {
    left: 30%; top: 60%;
    animation: chips-float 8s 1s infinite ease-in-out;
}
.chips-2 {
    left: 65%; top: 75%;
    animation: chips-float 9s infinite ease-in-out;
}

/* ===== Enhanced Chips Animations ===== */
.chips-snippet {
    position: absolute;
    width: clamp(30px, 6vw, 45px);
    height: clamp(30px, 6vw, 45px);
    background: linear-gradient(45deg, #f39c12, #e67e22);
    border-radius: 50% 20% 50% 20%;
    opacity: 0.9;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.chips-snippet::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    background: linear-gradient(45deg, #d68910, #f39c12);
    border-radius: 50% 15% 50% 15%;
    opacity: 0.7;
}

.chips-snippet-1 {
    left: 15%; top: 20%;
    animation: chips-bounce 4s infinite ease-in-out;
}

.chips-snippet-2 {
    left: 75%; top: 35%;
    animation: chips-bounce 5s 1s infinite ease-in-out;
}

.chips-snippet-3 {
    left: 45%; top: 70%;
    animation: chips-bounce 6s 2s infinite ease-in-out;
}

.chips-snippet-4 {
    left: 85%; top: 80%;
    animation: chips-bounce 4.5s 0.5s infinite ease-in-out;
}

.chips-snippet-5 {
    left: 25%; top: 85%;
    animation: chips-bounce 5.5s 1.5s infinite ease-in-out;
}

/* ===== Chips Spinning Animation ===== */
.chips-spin {
    position: absolute;
    width: clamp(35px, 7vw, 50px);
    height: clamp(35px, 7vw, 50px);
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    opacity: 0.8;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.chips-spin-1 {
    left: 20%; top: 15%;
    animation: chips-spin-rotate 8s infinite linear;
}

.chips-spin-2 {
    left: 70%; top: 25%;
    animation: chips-spin-rotate 10s infinite linear reverse;
}

.chips-spin-3 {
    left: 40%; top: 80%;
    animation: chips-spin-rotate 12s infinite linear;
}

/* ===== Chips Wave Animation ===== */
.chips-wave {
    position: absolute;
    width: clamp(25px, 5vw, 35px);
    height: clamp(25px, 5vw, 35px);
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    border-radius: 50%;
    opacity: 0.7;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.chips-wave-1 {
    left: 10%; top: 40%;
    animation: chips-wave-move 7s infinite ease-in-out;
}

.chips-wave-2 {
    left: 80%; top: 60%;
    animation: chips-wave-move 8s 2s infinite ease-in-out;
}

.chips-wave-3 {
    left: 60%; top: 30%;
    animation: chips-wave-move 6s 1s infinite ease-in-out;
}

/* ===== Chips Pulse Animation ===== */
.chips-pulse {
    position: absolute;
    width: clamp(20px, 4vw, 30px);
    height: clamp(20px, 4vw, 30px);
    background: linear-gradient(45deg, #9b59b6, #8e44ad);
    border-radius: 50% 20% 50% 20%;
    opacity: 0.6;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chips-pulse-1 {
    left: 35%; top: 25%;
    animation: chips-pulse-scale 3s infinite ease-in-out;
}

.chips-pulse-2 {
    left: 65%; top: 75%;
    animation: chips-pulse-scale 4s 1s infinite ease-in-out;
}

.chips-pulse-3 {
    left: 90%; top: 45%;
    animation: chips-pulse-scale 3.5s 0.5s infinite ease-in-out;
}

@keyframes popcorn-float {
    0% { transform: translateY(0) rotate(-10deg);}
    50% { transform: translateY(-40px) rotate(10deg);}
    100% { transform: translateY(0) rotate(-10deg);}
}

@keyframes chips-float {
    0% { transform: translateY(0) rotate(8deg);}
    50% { transform: translateY(-30px) rotate(-8deg);}
    100% { transform: translateY(0) rotate(8deg);}
}

@keyframes chips-bounce {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% { 
        transform: translateY(-20px) rotate(90deg) scale(1.1);
    }
    50% { 
        transform: translateY(-40px) rotate(180deg) scale(0.9);
    }
    75% { 
        transform: translateY(-20px) rotate(270deg) scale(1.05);
    }
}

@keyframes chips-spin-rotate {
    0% { 
        transform: rotate(0deg) translateX(0) scale(1);
    }
    25% { 
        transform: rotate(90deg) translateX(10px) scale(1.1);
    }
    50% { 
        transform: rotate(180deg) translateX(0) scale(0.9);
    }
    75% { 
        transform: rotate(270deg) translateX(-10px) scale(1.05);
    }
    100% { 
        transform: rotate(360deg) translateX(0) scale(1);
    }
}

@keyframes chips-wave-move {
    0%, 100% { 
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    25% { 
        transform: translateY(-15px) translateX(10px) rotate(90deg);
    }
    50% { 
        transform: translateY(-30px) translateX(0) rotate(180deg);
    }
    75% { 
        transform: translateY(-15px) translateX(-10px) rotate(270deg);
    }
}

@keyframes chips-pulse-scale {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 0.6;
    }
    50% { 
        transform: scale(1.3) rotate(180deg);
        opacity: 1;
    }
}

/* ===== Chips Rain Animation ===== */
.chips-rain {
    position: absolute;
    width: clamp(15px, 3vw, 25px);
    height: clamp(15px, 3vw, 25px);
    background: linear-gradient(45deg, #f1c40f, #f39c12);
    border-radius: 50% 30% 50% 30%;
    opacity: 0.8;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chips-rain-1 {
    left: 5%; top: -20px;
    animation: chips-rain-fall 4s infinite linear;
}

.chips-rain-2 {
    left: 25%; top: -20px;
    animation: chips-rain-fall 5s 1s infinite linear;
}

.chips-rain-3 {
    left: 45%; top: -20px;
    animation: chips-rain-fall 4.5s 0.5s infinite linear;
}

.chips-rain-4 {
    left: 65%; top: -20px;
    animation: chips-rain-fall 6s 2s infinite linear;
}

.chips-rain-5 {
    left: 85%; top: -20px;
    animation: chips-rain-fall 5.5s 1.5s infinite linear;
}

@keyframes chips-rain-fall {
    0% { 
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }
    10% { 
        opacity: 1;
    }
    90% { 
        opacity: 1;
    }
    100% { 
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ===== Falling Popcorn Animation ===== */
#pop_corn_container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 900;
}

.dot {
  width: clamp(25px, 6vw, 35px);
  height: clamp(25px, 6vw, 35px);
  position: absolute;
  top: -50px;
  background: url('https://contentservice.mc.reyrey.net/image_v1.0.0/?id=c1627fe5-a7e7-5fb7-af61-374c65707e3c&637384707423276230');
  background-size: 100% 100%;
  filter: drop-shadow(0px 0px 5px rgba(0,0,0,.25));
  pointer-events: none;
}

@keyframes pop {
  0% { transform: scale(.1);}
  3% { transform: scale(2);}
  6% { transform: scale(1);}
  100% { transform: scale(1) rotate(720deg); top: 105%;}
}

/* ===== RTL/LTR SPECIFIC STYLES ===== */

/* RTL Specific Styles */
[dir="rtl"] .navbar-nav .nav-link {
    margin: 0 0.5rem 0 0;
}

[dir="rtl"] .contact-item:hover {
    transform: translateX(-10px);
}

[dir="rtl"] .section-title::after {
    right: 50%;
    left: auto;
    transform: translateX(50%);
}

[dir="rtl"] .navbar-nav {
    margin-left: auto !important;
    margin-right: 0 !important;
    flex-direction: row-reverse;
}

[dir="rtl"] .scroll-to-top {
    right: auto;
    left: 30px;
}

[dir="rtl"] .notification {
    right: auto;
    left: 20px;
    transform: translateX(-100%);
}

[dir="rtl"] .notification.show {
    transform: translateX(0);
}

/* LTR Specific Styles */
[dir="ltr"] .navbar-nav .nav-link {
    margin: 0 0 0 0.5rem;
}

[dir="ltr"] .contact-item:hover {
    transform: translateX(10px);
}

[dir="ltr"] .scroll-to-top {
    left: auto;
    right: 30px;
}

[dir="ltr"] .notification {
    left: auto;
    right: 20px;
    transform: translateX(100%);
}

[dir="ltr"] .notification.show {
    transform: translateX(0);
}

/* Mobile Navigation RTL/LTR Fixes */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: block !important;
        z-index: 1100;
    }
    
    .navbar-collapse {
        background: linear-gradient(135deg, var(--primary-color) 0%, #1e3c72 100%);
        padding: 1rem;
        border-radius: 0 0 10px 10px;
        margin-top: 0.5rem;
    }
    
    [dir="rtl"] .navbar-toggler {
        right: auto !important;
        left: 1rem !important;
    }
    
    [dir="rtl"] .navbar-collapse {
        right: 0 !important;
        left: auto !important;
        text-align: right !important;
        direction: rtl !important;
    }
    
    [dir="ltr"] .navbar-toggler {
        left: auto !important;
        right: 1rem !important;
    }
    
    [dir="ltr"] .navbar-collapse {
        left: 0 !important;
        right: auto !important;
        text-align: left !important;
        direction: ltr !important;
    }
    
    .navbar-nav {
        flex-direction: column !important;
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        margin: 0.5rem 0 !important;
        text-align: center;
    }
    
    .d-flex.align-items-center {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
    }
}

/* Ensure #pop_corn_container never covers navbar */
#pop_corn_container {
    top: 70px; /* Adjusted for responsive navbar height */
}

@media (max-width: 768px) {
    #pop_corn_container {
        top: 60px;
    }
}

@media (max-width: 576px) {
    #pop_corn_container {
        top: 55px;
    }
}

/* ===== LOADING ANIMATION ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: clamp(40px, 10vw, 50px);
    height: clamp(40px, 10vw, 50px);
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
    position: fixed;
    bottom: clamp(20px, 5vw, 30px);
    right: clamp(20px, 5vw, 30px);
    width: clamp(40px, 10vw, 50px);
    height: clamp(40px, 10vw, 50px);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1e3c72 0%, #e67e22 100%);
}

/* ===== 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: 0;
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .scroll-to-top,
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators,
    #pop_corn_container,
    .snack-animations {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .contact-item:hover {
        transform: none;
    }
}

/* ===== LANDSCAPE ORIENTATION FIXES ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-slide {
        min-height: 100vh;
        padding: 1rem 0;
    }
    
    .hero-image img {
        max-width: 200px;
    }
    
    .display-4 {
        font-size: 1.8rem;
    }
    
    .display-5 {
        font-size: 1.5rem;
    }
    
    .lead {
        font-size: 0.9rem;
    }
    
    section {
        padding: 30px 0;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== REDUCED MOTION PREFERENCES ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating,
    .popcorn,
    .chips,
    .dot {
        animation: none !important;
    }
}

/* ===== PRODUCT SLIDESHOW SECTION ===== */
.slideshow-item {
    padding: 2rem 0;
}

.slideshow-item img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.slideshow-item img:hover {
    transform: scale(1.02);
}

.slideshow-caption h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 1rem;
}

#productSlideshow .carousel-indicators {
    bottom: -50px;
}

#productSlideshow .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: var(--primary-color);
    opacity: 0.5;
}

#productSlideshow .carousel-indicators button.active {
    opacity: 1;
    background-color: var(--secondary-color);
}

#productSlideshow .carousel-control-prev,
#productSlideshow .carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: rgba(44, 90, 160, 0.8);
    border-radius: 50%;
    margin: auto 1rem;
}

#productSlideshow .carousel-control-prev:hover,
#productSlideshow .carousel-control-next:hover {
    background-color: rgba(44, 90, 160, 1);
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #ecf0f1;
        --text-muted: #bdc3c7;
        --light-color: #2c3e50;
        --border-color: #34495e;
    }
    
    body {
        background-color: #1a252f;
        color: var(--text-dark);
    }
    
    .contact-info,
    .contact-form,
    .factory-info {
        background: #2c3e50;
        color: var(--text-dark);
    }
    
    .form-control {
        background-color: #34495e;
        border-color: #4a5f7a;
        color: var(--text-dark);
    }
    
    .form-control:focus {
        background-color: #34495e;
        border-color: var(--primary-color);
    }
}
/* .work-times-table {
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(44,90,160,0.07);
    max-width: 340px;
    margin-top: 8px;
}

.work-times-table table {
    width: 100%;
    font-size: 1rem;
}

.work-times-table td {
    padding: 6px 12px;
    color: #2c5aa0;
    font-weight: 500;
    vertical-align: middle;
} */

.work-times-table .text-danger {
    color: #e74c3c !important;
    font-weight: bold;
}
/* ===== GALLERY SECTION ENHANCEMENT ===== */
.gallery-card {
    aspect-ratio: 1/1;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    position: relative;
}

.gallery-card:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 32px rgba(44, 90, 160, 0.18);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s;
    filter: brightness(0.98) contrast(1.05) drop-shadow(0 4px 16px rgba(44,90,160,0.08));
}

.gallery-card:hover .gallery-img {
    filter: brightness(1.05) contrast(1.1) drop-shadow(0 8px 24px rgba(44,90,160,0.15));
}
