﻿/* =====================================================
   GLOBAL HEADER OFFSET FIX (HERO VISIBILITY SOLUTION)
   PROFESSIONAL SIDE-BY-SIDE LAYOUT - NO CART SCROLL
   FULLY MOBILE RESPONSIVE
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding-top: 80px;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F6FBF8;
    color: #2C3E50;
    overflow-x: hidden;
    width: 100%;
}

/* =====================================================
   HERO SECTION (FULL SCREEN START)
===================================================== */
.hero {
    min-height: calc(100vh - 80px);
    background: url('/Content/Images/order.jpg') center/cover no-repeat;
    position: relative;
    width: 100%;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(30,132,73,.93) 45%, rgba(30,132,73,.55) 70%, transparent 100%);
    display: flex;
    align-items: center;
}

.hero-content {
    color: white;
    width: 50%;
    padding-left: 90px;
}

.hero h1 {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 15px;
}

.hero p {
    font-size: 20px;
    opacity: .95;
}

.hero-btn {
    background: #F4B400;
    padding: 14px 28px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    display: inline-block;
    margin-top: 20px;
    box-shadow: 0 6px 14px rgba(0,0,0,.15);
    transition: .3s;
}

    .hero-btn:hover {
        transform: translateY(-2px);
    }

/* =====================================================
   MAIN ORDER LAYOUT - PROFESSIONAL SIDE-BY-SIDE
   NO SCROLLING IN CART - FULL VISIBILITY
===================================================== */
.order-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 30px;
}

.order-layout {
    display: flex;
    flex-direction: row;
    gap: 35px;
    align-items: flex-start;
}

/* =====================================================
   CART PANEL (LEFT SIDE) - STICKY CART, NO SCROLLBAR
   ===================================================== */
.cart-panel {
    flex: 0 0 35%;
    min-width: 320px;
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 20px 35px rgba(0,0,0,.08);
    position: sticky;
    top: 100px;
    align-self: flex-start;
    /* NO max-height - NO SCROLLBAR */
    transition: all 0.3s ease;
}

/* BUYER INFO BOX */
.dealer-box {
    background: #F6FBF8;
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 2px solid #E3F3EA;
}

    .dealer-box h3 {
        color: #1E8449;
        margin-top: 0;
        margin-bottom: 12px;
        font-size: 20px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .dealer-box h3::before {
            content: "👤";
            font-size: 18px;
        }

    .dealer-box input {
        width: 100%;
        padding: 12px 14px;
        margin-top: 8px;
        border-radius: 10px;
        border: 1.5px solid #E0E8E4;
        font-size: 15px;
        transition: all 0.2s;
    }

        .dealer-box input:focus {
            border: 2px solid #27AE60;
            outline: none;
            box-shadow: 0 0 0 3px rgba(39,174,96,0.1);
        }

/* CART TABLE - FULL VISIBILITY, NO SCROLL */
.cart-table-container {
    overflow-x: visible;
    margin: 20px 0;
    border-radius: 12px;
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #1E8449;
    color: white;
    padding: 12px 10px;
    font-weight: 600;
    text-align: left;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #E8F6EF;
}

/* BIG TOTAL BOX */
.total-box {
    text-align: center;
    margin: 25px 0 20px;
    background: linear-gradient(135deg, #1E8449, #27AE60);
    color: white;
    padding: 20px;
    border-radius: 16px;
}

    .total-box p {
        font-size: 14px;
        opacity: 0.9;
        letter-spacing: 1px;
    }

    .total-box h1 {
        font-size: 42px;
        margin: 8px 0 0;
        font-weight: 800;
    }

/* ORDER BUTTONS */
.order-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: #1E8449;
    color: white;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .order-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(30,132,73,0.3);
    }

    .order-btn.green {
        background: #25D366;
    }

        .order-btn.green:hover {
            background: #20b859;
        }

/* =====================================================
   PRODUCTS PANEL (RIGHT SIDE) - PRODUCTS ONLY
   ===================================================== */
.products-panel {
    flex: 1;
    min-width: 0;
}

.crop-card {
    background: white;
    padding: 28px;
    border-radius: 20px;
    box-shadow: 0 12px 25px rgba(0,0,0,.05);
    margin-bottom: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
}

    .crop-card:hover {
        box-shadow: 0 15px 35px rgba(0,0,0,.1);
    }

.crop-title {
    font-size: 28px;
    color: #1E8449;
    margin-bottom: 20px;
    font-weight: 800;
    padding-bottom: 12px;
    border-bottom: 3px solid #E8F6EF;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .crop-title::before {
        content: "🌾";
        font-size: 28px;
    }

/* VARIETY GRID */
.variety-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.variety-card {
    border: 2px solid #E8F6EF;
    padding: 18px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    background: white;
}

    .variety-card:hover {
        border-color: #27AE60;
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }

.variety-info {
    flex: 1;
}

.variety-name {
    font-weight: 700;
    font-size: 16px;
    color: #2C3E50;
    margin-bottom: 6px;
}

.variety-price {
    font-size: 14px;
    color: #1E8449;
    font-weight: 600;
}

/* QTY CONTROLS */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.qty-box button {
    width: 34px;
    height: 34px;
    font-size: 18px;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    background: #1E8449;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

    .qty-box button:hover {
        background: #166b3c;
        transform: scale(1.02);
    }

    .qty-box button:active {
        transform: scale(0.98);
    }

.qty-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

/* ADD BUTTON */
.add-btn {
    background: #27AE60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

    .add-btn:hover {
        background: #1E8449;
        transform: translateY(-1px);
    }

/* =====================================================
   RESPONSIVE BREAKPOINTS
   KEEPS SIDE-BY-SIDE UNTIL MOBILE BREAKPOINT
   NO SCROLLBAR IN CART - FULL VISIBILITY
   ===================================================== */

/* LAPTOP / TABLET LANDSCAPE (1024px - 1200px) */
@media screen and (max-width: 1200px) {
    .cart-panel {
        flex: 0 0 38%;
        min-width: 300px;
    }

    .hero-content {
        padding-left: 60px;
        width: 55%;
    }

    .hero h1 {
        font-size: 45px;
    }

    .crop-title {
        font-size: 24px;
    }
}

/* TABLET PORTRAIT & SMALL LAPTOP (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .order-wrapper {
        padding: 30px 20px;
    }

    .order-layout {
        gap: 25px;
    }

    .cart-panel {
        flex: 0 0 40%;
        min-width: 280px;
        padding: 20px;
        top: 90px;
    }

    .products-panel {
        flex: 1;
    }

    .variety-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .hero-content {
        width: 65%;
        padding-left: 40px;
    }

    .hero h1 {
        font-size: 38px;
    }

    .total-box h1 {
        font-size: 36px;
    }
}

/* MOBILE (BELOW 768px) - STACK VERTICALLY */
@media screen and (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .order-wrapper {
        padding: 20px 15px;
    }

    /* STACK ON MOBILE */
    .order-layout {
        flex-direction: column;
        gap: 25px;
    }

    .cart-panel {
        flex: auto;
        width: 100%;
        min-width: auto;
        position: relative;
        top: 0;
        order: 1;
        margin-bottom: 0;
    }

    .products-panel {
        width: 100%;
        order: 2;
    }

    .hero {
        min-height: 450px;
    }

    .hero-overlay {
        background: linear-gradient(135deg, rgba(30,132,73,.95) 0%, rgba(30,132,73,.8) 70%, rgba(30,132,73,.5) 100%);
    }

    .hero-content {
        width: 85%;
        padding-left: 25px;
        padding-right: 20px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 15px;
    }

    .hero-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .crop-card {
        padding: 20px;
    }

    .crop-title {
        font-size: 22px;
    }

    .variety-card {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .variety-info {
        flex: 1;
    }

    .qty-controls {
        margin-bottom: 0;
    }

    .add-btn {
        width: auto;
        min-width: 80px;
    }

    .total-box h1 {
        font-size: 32px;
    }

    .order-btn {
        padding: 14px;
    }
}

/* SMALL MOBILE (480px and below) */
@media screen and (max-width: 480px) {
    body {
        padding-top: 55px;
    }

    .order-wrapper {
        padding: 15px 12px;
    }

    .cart-panel {
        padding: 16px;
        border-radius: 16px;
    }

    .dealer-box {
        padding: 14px;
    }

        .dealer-box h3 {
            font-size: 18px;
        }

        .dealer-box input {
            padding: 10px 12px;
            font-size: 14px;
        }

    .cart-table-container {
        margin: 15px 0;
        overflow-x: auto; /* Only horizontal scroll if table too wide, NO vertical scroll */
    }

    table {
        font-size: 13px;
        min-width: 400px;
    }

    th, td {
        padding: 10px 8px;
    }

    .total-box {
        padding: 16px;
    }

        .total-box h1 {
            font-size: 28px;
        }

    .order-btn {
        padding: 12px;
        font-size: 15px;
    }

    .crop-card {
        padding: 16px;
        border-radius: 16px;
    }

    .crop-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

        .crop-title::before {
            font-size: 22px;
        }

    .variety-card {
        padding: 14px;
        flex-direction: column;
        text-align: center;
    }

    .variety-info {
        margin-bottom: 10px;
    }

    .qty-controls {
        justify-content: center;
        margin-bottom: 10px;
    }

    .add-btn {
        width: 100%;
        padding: 10px;
    }

    .hero {
        min-height: 400px;
    }

        .hero h1 {
            font-size: 26px;
        }

        .hero p {
            font-size: 13px;
        }

    .hero-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
}

/* EXTRA SMALL (320px - 375px) */
@media screen and (max-width: 375px) {
    .hero h1 {
        font-size: 22px;
    }

    .cart-panel {
        padding: 14px;
    }

    .total-box h1 {
        font-size: 24px;
    }

    .crop-title {
        font-size: 18px;
    }

    .variety-name {
        font-size: 14px;
    }

    .qty-box button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}

/* LARGE DESKTOP (1400px+) */
@media screen and (min-width: 1400px) {
    .order-wrapper {
        max-width: 1600px;
        padding: 50px 40px;
    }

    .cart-panel {
        flex: 0 0 32%;
        padding: 28px;
    }

    .variety-grid {
        gap: 25px;
    }

    .crop-card {
        padding: 32px;
    }
}

/* TOUCH OPTIMIZATION */
@media (hover: none) and (pointer: coarse) {
    .order-btn, .add-btn, .qty-box button, .hero-btn {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

        .order-btn:active, .add-btn:active, .qty-box button:active {
            transform: scale(0.97);
        }

    .variety-card:hover {
        transform: none;
    }
}

/* PRINT STYLES */
@media print {
    .hero, .order-btn, .add-btn, .qty-box button {
        display: none;
    }

    .cart-panel {
        position: static;
        box-shadow: none;
    }

    body {
        padding-top: 0;
    }
}
