/* Map Section */
.feature-item {
    display: flex;
    align-items: center;
    font-size: 32px;
    color: #2fb979;
    font-weight: bold;
    margin-bottom: 20px;
}
.feature-item img { width: 30px; margin-right: 15px; }

/* Timeline */
.timeline-section { position: relative; padding: 60px 0; }
.timeline-line {
    position: absolute;
    width: 8px;
    background-image: linear-gradient(to bottom, #2fb979 50%, transparent 50%);
    background-size: 8px 30px;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 0;
}
.timeline-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    z-index: 1;
}
.timeline-card img { max-height: 120px; margin-bottom: 15px; }

@media (max-width: 768px) {
    .timeline-line { left: 20px; }
}

/* Buttons */
.btn-rounded { border-radius: 25px; padding: 8px 25px; font-size: 0.9rem; }
        
/* --- BRANDS HEADER WITH DEEP IMAGE WAVE --- */
.brands-header-wrapper {
    position: relative;
    background-color: var(--primary-green);
    padding: 140px 0;
    margin: 100px 0; /* Space for the waves to overflow */
    text-align: center;
    color: white;
}

.image-wave-top, .image-wave-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100px; /* Depth of the wave */
    background-image: url('wave-pattern.png'); /* USE YOUR UPLOADED IMAGE HERE */
    background-repeat: repeat-x;
    background-size: auto 100%;
    z-index: -1;
}

.image-wave-top {
    top: -99px;
    background-position: bottom;
}

.image-wave-bottom {
    bottom: -99px;
    background-position: top;
    transform: rotate(180deg);
}

/* Floating Items in Header */
.floating-item { position: absolute; z-index: 5; animation: float 6s ease-in-out infinite; }
.floating-item img { max-height: 130px; border-radius: 8px; }
.fi-1 { top: 10%; left: 8%; animation-delay: 0s; transform: rotate(-10deg); }
.fi-2 { top: 0; left: 25%; animation-delay: 1s; transform: rotate(15deg); }
.fi-3 { top: -5%; left: 50%; animation-delay: 2s; }
.fi-4 { top: 0%; right: 25%; animation-delay: 0.5s; transform: rotate(-15deg); }
.fi-5 { top: 10%; right: 8%; animation-delay: 1.5s; transform: rotate(10deg); }
.fi-6 { bottom: 0; left: 15%; animation-delay: 1.2s; }
.fi-7 { bottom: -10%; left: 36%; animation-delay: 2.5s; }
.fi-8 { bottom: -10%; right: 40%; animation-delay: 0.8s; }
.fi-9 { bottom: 0; right: 15%; animation-delay: 0.2s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* --- Spiral Timeline Section --- */
.spiral-timeline { 
    position: relative; 
    padding: 120px 0; /* Increased overall padding for more space */
    overflow: hidden; 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* Central vertical dashed line */
.center-dashed-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 6px;
    background-image: linear-gradient(to bottom, #2fb979 60%, transparent 40%);
    background-size: 6px 40px;
    transform: translateX(-50%);
    z-index: 1;
}

/* Branch container */
.spiral-branch {
    position: relative;
    width: 50%;
    height: 600px; /* Increased height to accommodate larger content */
    margin-bottom: -50px; 
    z-index: 2;
}

.spiral-branch.left {
    float: left;
    clear: both;
}
.spiral-branch.right {
    float: right;
    clear: both;
}

/* SVG Dashed Paths */
.spiral-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
.spiral-svg path {
    fill: none;
    stroke: #2fb979;
    stroke-width: 6;
    stroke-dasharray: 12, 10;
    stroke-linecap: round;
}

/* Central Content Box (Text & Button) */
.spiral-center-content {
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%);
    width: 320px; /* Increased width */
    text-align: center;
    z-index: 3;
    padding: 30px 25px; /* Increased padding */
    border-radius: 15px;
}
.spiral-center-content-right {
    top: 40%;
    left: 55%;
}
.spiral-center-content img.brand-logo {
    max-width: 140px; /* Increased logo size */
    margin-bottom: 15px;
}
.spiral-center-content h4 {
    font-size: 1.35rem; /* Increased heading size */
    font-weight: 800;
    margin-bottom: 12px; /* Adjusted margin */
}
.spiral-center-content p {
    font-size: 0.95rem; /* Increased paragraph text size */
    color: #666;
    line-height: 1.6; /* Slightly increased line height for readability */
    margin-bottom: 25px; /* Adjusted margin */
    font-family: 'Open Sans', sans-serif;
}

/* Product Images positioned along the spiral */
.prod-item {
    position: absolute;
    z-index: 4;
    max-height: 150px; /* Increased product image width */
    height: auto;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}
.prod-item:hover {
    transform: translate(-50%, -50%) scale(1.35); /* Adjusted hover scale for new size */
    z-index: 10;
}

/* Responsive fallback */
@media (max-width: 991px) {
    .center-dashed-line { left: 20px; }
    .spiral-branch { width: 100%; height: auto; padding: 40px 0 40px 50px; margin-bottom: 20px; float: none; }
    .spiral-svg { display: none; /* Hide complex SVG on mobile */ }
    .spiral-center-content { position: relative; top: auto; left: auto; transform: none; width: 100%; text-align: left; background: none; }
    .prod-item { position: relative; display: inline-block; top: auto !important; left: auto !important; transform: none !important; margin: 5px; }
    .prod-item:hover { transform: scale(1.1) !important; }
}

/* Cards Hover Effect (News Section) */
.hover-card { transition: all 0.3s ease; border-radius: 15px; overflow: hidden; border: none !important; box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important; }
.hover-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important; }

/* Enforce square images for news cards */
.card .card-img-top {
    width: 100%;
    height: 280px; /* Set a fixed height to make it square with the width */
    object-fit: cover; /* Ensures the image covers the area without distorting aspect ratio */
    border-top-left-radius: 15px; /* Maintain card border-radius */
    border-top-right-radius: 15px; /* Maintain card border-radius */
}


.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 50px auto;
    min-height: 1200px;
}

/* The vertical dashed "stem" */
.center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 8px;
    background-image: linear-gradient(to bottom, var(--primary-green) 60%, transparent 40%);
    background-size: 8px 30px; /* Adjust for dash spacing */
    transform: translateX(-50%);
    z-index: 1;
}

/* Each brand section */
.brand-row {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 2;
    margin-bottom: -60px; /* Pulls rows closer together */
}

.brand-col {
    width: 50%;
    position: relative;
    height: 480px; /* Height of your spiral PNG */
}

/* Spiral Image Layer */
.spiral-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Content (Logo/Text/Button) Layer */
.content-box {
    position: absolute;
    width: 250px;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Specific positions for Left Branch */
.brand-row.left { justify-content: flex-start; }
.brand-row.left .spiral-bg {
    background-image: url('left-spirals.png');
    background-position: right center;
}
/* Offset content slightly to fit inside the spiral loop */
.brand-row.left .content-box { margin-left: -75px; margin-top: -65px; }

/* Specific positions for Right Branch */
.brand-row.right { justify-content: flex-end; }
.brand-row.right .spiral-bg {
    background-image: url('right-spirals.png');
    background-position: left center;
}
.brand-row.right .content-box { margin-left: 80px; margin-top: -65px; }

/* Typography & UI */
.content-box img.logo { max-width: 140px; margin-bottom: 10px; }
.content-box h3 { font-size: 18px; font-weight: bold; margin: 5px 0; }
.content-box p { font-size: 13px; color: #555; line-height: 1.4; margin-bottom: 15px; }

.spiral-btn {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 20px;
    text-decoration: none;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    transition: 0.3s ease;
}

/* Colors based on brand */
.c-red { color: #E21E26; } .bg-red { background-color: #E21E26; }
.c-blue { color: #004990; } .bg-blue { background-color: #004990; }
.c-green { color: #005A31; } .bg-green { background-color: #005A31; }
.bg-black { background-color: #000; }

.spiral-btn:hover { transform: scale(1.05); opacity: 0.9; }

.product-spiral {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1; /* Sits behind the text box but on top of the dashed line */
}

/* Base style for the pasta bags */
.spiral-bag {
    position: absolute;
    height: auto;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.spiral-bag:hover {
    transform: scale(1.1) !important; /* Pop effect on hover */
    z-index: 10;
}

/* Positioning each bag along the LEFT spiral path */
/* Coordinates are relative to the .brand-col container */

.p1 { bottom: 38%; right: 2%;  transform: rotate(10deg); }   /* Starts at the center stem */
.p2 { bottom: 16%; right: 35%; transform: rotate(10deg); }
.p3 { bottom: 23%; left: 15%;  transform: rotate(-10deg); }
.p4 { top: 23%;    left: -3%;   transform: rotate(-10deg); }
.p5 { top: -3%;     left: 15%;  transform: rotate(10deg); }
.p6 { top: 12%;    right: 33%; transform: rotate(10deg); } /* Ends near the top loop */

/* Adjusting the content box slightly to center it inside the spiral */
.brand-row.left .content-box {
    z-index: 6; /* Keeps text above bags */
}

.pr1 { bottom: 40%; left: 5%;   transform: rotate(-10deg); }  /* Connects to center stem */
.pr2 { bottom: 18%; left: 35%;  transform: rotate(10deg); }
.pr3 { bottom: 20%; right: 15%; transform: rotate(10deg); }
.pr4 { top: 25%;    right: -3%;  transform: rotate(10deg); }
.pr5 { top: -9%;     right: 25%; transform: rotate(-10deg); }
.pr6 { top: 15%;    left: 35%;  transform: rotate(-10deg); } /* Ends the top loop */

/* Ensure the text box is centered on the right side */
.brand-row.right .content-box {
    z-index: 6;
}

@media (max-width: 768px) {
    .floating-item img { max-height: 80px; border-radius: 4px; }
    /* Keep the dashed line in the center */
    .center-line {
        left: 50%;
        width: 4px; /* Thinner line for mobile */
    }

    /* Keep the side-by-side zigzag layout or stack it */
    /* To keep the spiral visible, we must maintain column height */
    .brand-col {
        height: 350px; /* Reduced height for smaller screens */
    }

    /* Shrink the bags for mobile */
    .spiral-bag {
        width: 42px; /* Small images for mobile */
    }

    /* Adjust the text box size to fit inside smaller spiral */
    .content-box {
        width: 90px;
    }
    .content-box img.logo {
        display: block;
        max-width: 80px !important; /* Smaller logo for mobile */
    }
    .content-box h3 {
        display: none;
    }
    .content-box p {
        display: none; /* Hide description on tiny screens to save space */
    }

    .p1 { bottom: 40%; right: 5%;  transform: rotate(10deg); }   /* Starts at the center stem */
    .p2 { bottom: 27%; right: 35%; transform: rotate(10deg); }
    .p3 { bottom: 30%; left: 15%;  transform: rotate(-10deg); }
    .p4 { top: 25%;    left: -3%;   transform: rotate(-10deg); }
    .p5 { top: 12%;     left: 15%;  transform: rotate(10deg); }
    .p6 { top: 20%;    right: 35%; transform: rotate(10deg); }

    .pr1 { bottom: 40%; left: 5%;   transform: rotate(-10deg); }  /* Connects to center stem */
    .pr2 { bottom: 27%; left: 35%;  transform: rotate(10deg); }
    .pr3 { bottom: 29%; right: 15%; transform: rotate(10deg); }
    .pr4 { top: 25%;    right: -5%;  transform: rotate(10deg); }
    .pr5 { top: 10%;     right: 25%; transform: rotate(-10deg); }
    .pr6 { top: 15%;    left: 35%;  transform: rotate(-10deg); }

    .brand-row.left .content-box {
        margin-left: -37px;
        margin-top: -25px;
    }

    .brand-row.right .content-box { 
        margin-left: 45px; 
        margin-top: -25px; 
    }

    .spiral-btn {
        width: 30%;
        display: inline-flex;
  justify-content: center; /* Centers horizontally */
  align-items: center; 
    }
}