@import url('/resources/css/home/resources/variables.css');
@import url('/resources/css/home/resources/footer.css');
@import url('/resources/css/home/resources/modals.css');
@import url('/resources/css/home/resources/header.css');
@import url('/resources/css/home/resources/buttons.css');
@import url('/resources/css/home/resources/companies.css');

/* Hero Section */
.hero {
    background: var(--glass);
    padding: 6rem 0 4rem 0;
}

.hero-container {
    max-width: 80vw;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 40% 50%;
    gap: 8rem;
    align-items: center;
    padding: 0;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--muted);
}

.hero-content h1 .highlight {
    color: var(--accent);
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--muted);
    margin-bottom: 2rem;
}

.hero-image {
    background: url('/resources/home/resources/image/bg-landing-main.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    height: 400px; /* Use fixed height instead of max-height */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Prevent overflow */
}

.hero-image img {
    margin-left: 40px;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    z-index: 1;
    position: relative;
    object-fit: fill;
}

/* Sales Section */
.sales-section {
    padding: 4rem 0;
    background: url('/resources/home/resources/image/sales-background.png') repeat-x center center;
}

.section-container {
    max-width: 80vw;
    margin: 0 auto;
    padding: 0;
}

.section-title {
    margin-top: 2rem;
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    color: #1e293b;
}

.sales-content {
    display: grid;
    grid-template-columns: 42% 50%;
    gap: 8rem;
    align-items: center;
}

.sales-text {
    padding: 2rem;
    border-radius: 12px;
}

.sales-text p {
    margin-bottom: 1rem;
    color: #475569;
}

.sales-icons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.icon-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
}

.icon-item i {
    font-size: 2rem;
    color: #4f46e5;
    margin-bottom: 1rem;
}

/* How it Works */
.how-it-works {
    background: var(--glass);
    padding: 4rem 0;
}

.steps {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 3rem;
    align-items: center;
}

.steps-content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    position: relative;
}

.step0 {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-left: calc(0 * 35px); /* indent each step a bit */
}

.step1 {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-left: calc(1 * 35px); /* indent each step a bit */
}

.step2 {
    display: flex;
    align-items: flex-start;
    position: relative;
    padding-left: calc(2 * 35px); /* indent each step a bit */
}

.step-number {
    font-size: 3.5rem;
    font-weight: 900;
    color: rgba(255, 107, 107, 0.4);
    line-height: 1;
    text-align: center;
    width: 60px;
    position: relative;
    flex-shrink: 0;
}

.step:nth-child(2) .step-number {
    color: rgba(255, 107, 107, 0.7);
}

.step:nth-child(3) .step-number {
    color: rgba(255, 107, 107, 1);
}

.step-text h3 {
    font-size: 1.2rem;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    color: #2C3241;
    font-weight: 500;
    line-height: 1.3;
}

.step-text p {
    color: #64748b;
}

.connector-1 {
    position: absolute;
    top: 100%; /* drop below number */
    left: calc(1 * 30px); /* align under number */
}

.connector-2 {
    position: absolute;
    top: 100%; /* drop below number */
    left: calc(2 * 30px); /* align under number */
}

.steps-illustration {
    background: #e5e7eb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.steps-illustration img {
    object-fit: fill;
}

/* Service Section */
.service-section {
    background: #1e293b;
    color: white;
    padding: 4rem 0;
}

.service-content {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 3rem;
    align-items: center;
}

.service-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.service-text p {
    opacity: 0.9;
}

.service-image {
    background: #374151;
    width: fit-content;
    height: fit-content;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.service-image img {
    object-fit: fill;
    width: 100%;
    height: 100%;
}

/* Comparison Table */
.comparison {
    background: var(--glass);
    max-width: 80vw;
    margin: 0 auto;
    padding: 2rem 0;
}

.comparison-wrap {
    position: relative;
    max-width: 80vw;
    margin: 0 auto;
}

/* table base */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #fff;
}

/* set column widths */
.comparison-table colgroup col:nth-child(1) {
    width: var(--first-col);
}

.comparison-table colgroup col:nth-child(2) {
    width: var(--deliv-col);
}

.comparison-table colgroup col:nth-child(3) {
    width: var(--vs-col);
}

.comparison-table colgroup col:nth-child(4) {
    width: 1fr;
}

.comparison-table colgroup col:nth-child(5) {
    width: 1fr;
}

.comparison-table colgroup col:nth-child(6) {
    width: 1fr;
}

thead th {
    background: #f8fafc;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
    text-align: center;
    height: var(--row-h);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    padding: 0 12px;
}

thead th.label-header {
    text-align: left;
    padding-left: 18px;
    font-weight: 600;
    font-size: 14px;
}

thead th.delivereo-header {
    padding-top: 8px;
}

/* for the logo */
tbody td {
    background: #fff;
    height: var(--row-h);
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    font-size: 16px;
}

tbody td.label {
    text-align: left;
    padding-left: 18px;
    font-family: 'Montserrat', serif;
}

td.center {
    text-align: center;
}

/* delivereo logo */
.delivereo-logo img {
    max-width: 86px;
    display: block;
    margin: 6px auto;
}

/* VS vertical bar: absolute, behind the tbody rows */
.vs-bar {
    position: absolute;
    left: calc(var(--first-col) + var(--deliv-col));
    top: calc(var(--row-h) - 50px); /* start below header */
    bottom: 10px;
    width: var(--vs-col);
    background: var(--blue);
    border-radius: 12px;
    z-index: 999;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.vs-bar span {
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 34px;
    line-height: 1;
    display: block;
    margin-top: 10px;
}

/* icons (using inline SVG; colors match Figma) */
.icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.check svg {
    fill: none;
    stroke: var(--blue);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cross svg {
    fill: none;
    stroke: var(--red);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ensure cells sit above the blue bar */
thead th, tbody td {
    position: relative;
    z-index: 2;
}

/* responsive: allow horizontal scroll on narrow devices */
.comparison-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

/* Contact Section */
.contact {
    background: #f8fafc;
    padding: 4rem 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 3rem;
    align-items: center;
}

.contact-info {
    width: 100%;
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

.contact-details {
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-item a {
    text-decoration: none;
    margin-left: -10px;
}

.contact-item i {
    color: #4f46e5;
}

.contact-image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.contact-image img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: block;
}

/* Deliverers */
.final-cta {
    background: var(--blue);
    color: var(--glass);
    padding: 4rem 0;
}

.cta-content {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 3rem;
    align-items: center;
}

.cta-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-text p {
    margin-bottom: 14px;
}

.cta-text .cta-button {
    margin-top: 10px;
}

.cta-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Terms */
.term {
    padding: 110px 135px 0 135px;
}

.faq-item {
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--glass);
}

.faq-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.faq-item span {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 980px) {
    :root {
        --first-col: 180px;
        --deliv-col: 80px;
        --vs-col: 56px;
        --row-h: 56px;
    }

    .vs-bar span {
        font-size: 26px;
    }

    .term {
        padding: 110px 32px 0 32px;
    }
}

@media (max-width: 900px) {
    .sales-icons img {
        width: 40vw;
        max-width: max-content;
        height: auto;
        display: block;
        margin: 0 auto;
        object-fit: contain;
    }

    .cta-illustration img {
        width: 80%;
        max-width: max-content;
        height: auto;
        display: block;
        margin: 0 auto;
        object-fit: contain;
    }

    .steps-content {
        gap: 2rem;
    }

    .step {
        padding-left: 0 !important;
    }

    .connector-1,
    .connector-2 {
        position: static !important;
        display: block;
        width: 100% !important;
        height: 2px !important;
        margin: 12px 0;
        left: 0 !important;
        background: none !important; /* Remove any background */
    }

    .connector-1 path,
    .connector-2 path {
        display: none;
    }

    .connector-1::after,
    .connector-2::after {
        content: "";
        display: block;
        width: 100%;
        height: 2px;
        background: #3023FF;
    }

    .step-number {
        font-size: 3.5rem;
        font-weight: 900;
        color: rgba(255, 107, 107, 0.4);
        line-height: 1;
        text-align: center;
        width: 60px;
        position: relative;
        flex-shrink: 0;
    }

    .step:nth-child(1) .step-number {
        color: rgba(159, 234, 237, 0.89);
    }

    .step:nth-child(2) .step-number {
        color: rgba(116, 209, 213, 0.96);
    }

    .step:nth-child(3) .step-number {
        color: rgb(75, 194, 197);
    }

    .term {
        padding: 110px 32px 0 32px;
    }
}

@media (max-width: 768px) {
    :root {
        --vs-col: 40px;
    }

    .hero {
        background: var(--glass);
        padding: 2rem 0 4rem 0;
    }

    .hero-container {
        flex-direction: column;
        display: flex;
        gap: 2rem;
        align-items: stretch;
    }

    .sales-content {
        flex-direction: column;
        display: flex;
        gap: 2rem;
        align-items: stretch;
    }

    .hero-content {
        display: contents;
    }

    .hero-container .hero-content h1 {
        font-size: 2.1rem;
        order: 1;
        margin: 0;
    }

    .hero-container .hero-content p {
        order: 2;
        font-size: 1.3rem;
        margin: 0;
    }

    .hero-container .hero-image {
        order: 3;
        margin: 0;
    }

    .hero-container .hero-content .cta-button {
        order: 4;
        width: 100%;
        text-align: center;
    }

    /* Optional: make the image fit nicer on mobile */
    .hero-image {
        height: auto;
        min-height: 260px;
    }

    .hero-image img {
        margin-left: 0;
        object-fit: contain;
    }

    .sales-icons {
        display: flex;
        justify-content: center;
        align-items: center;
        margin-top: 1rem;
    }

    .sales-icons img {
        width: 80%;
        max-width: 320px;
        height: auto;
        display: block;
        margin: 0 auto;
    }

    .sales-text {
        padding: 1rem 1rem;
        text-align: justify;
    }

    .sales-text .cta-button {
        width: 100%;
        display: block;
        margin-top: 1.5rem;
        font-size: 1rem;
        text-align: center;
    }

    .steps,
    .service-content {
        display: flex;
        flex-direction: column;
    }

    .service-image {
        order: -1;
        width: 100%;
        display: flex;
        height: fit-content;
        justify-content: center;
        align-items: center;
        padding: 0;
    }

    .service-image img {
        width: 100%;
        max-width: 320px;
        height: auto;
        display: block;
        margin: 0 auto;
        object-fit: contain;
    }

    .cta-illustration {
        width: 90%;
        height: fit-content;
    }

    .cta-illustration img {
        width: 100%;
        max-width: 90vw;
        height: auto;
        display: block;
        margin: 0 auto;
        object-fit: contain;
    }

    .contact-content {
        display: block;
        width: 100%;
        padding: 0;
    }

    .contact-info {
        width: 100%;
        margin: 0 auto;
    }

    .contact-image {
        display: none;
    }

    .cta-content {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .vs-bar {
        left: calc(var(--first-col) + var(--deliv-col) - 24px); /* move it further right */
    }

    .term {
        padding: 32px 16px 0 16px;
    }

    .term h1 {
        margin-top: 60px; /* Adjust the value as needed */
    }
}