/* =========================================================
   SHAMBA - PHONE
   Loaded after desktop styles so phone landscape can override
   tablet/desktop rules when needed.
   ========================================================= */

/* DATA TABLE */
table.data-table {
    font-size: 0.8rem;
}

table.data-table th,
table.data-table td {
    padding: 8px 6px;
}

.dt-container .dt-search input {
    width: 100%;
    box-sizing: border-box;
}


.dt-layout-row {
    display: block;
}

.dt-length,
.dt-search,
.dt-info,
.dt-paging {
    width: 100%;
    margin: 0.75rem 0;
}

.dt-search {
    margin-left: 0;
}

.dt-search input {
    width: 75% !important;
    min-width: 0;
    box-sizing: border-box;
}

.dt-paging {
    justify-content: center;
    flex-wrap: wrap;
}

.dt-info {
    text-align: center;
}

.two-column-grid {
    grid-template-columns: 1fr;
}

/* BANNER */
.new-order-banner {
    background: #fff8e7;
    color: #333;
    border-top: 1px solid #e6d29a;
    border-bottom: 1px solid #e6d29a;
}

.new-order-banner-message strong {
    color: #315b3a;
}

.new-order-banner-message span {
    color: #555;
}

.new-order-banner-content {
    align-items: flex-start;
}

.new-order-banner-icon {
    font-size: 24px;
}

.new-order-banner-message strong {
    font-size: 16px;
}

.new-order-banner-actions {
    display: grid;
    grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);

    gap: 8px;
}

.new-order-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#newOrderBannerOk {
    width: 75%;
    margin: 10px auto;
}

.dev-banner a {
    display: block;
    margin: 4px 0 0;
}

.edit-row {
    margin-bottom: 16px;
}

/* Inventory/card phone defaults that were previously max-width rules */

/* From original lines 1280-1301 */

input[type="date"] {
    min-width: 0;
}

input[type="date"].text-input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.order-filter-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.order-filter-field input[type="date"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.vendor-schedule-times, .vendor-delivery-day-settings {
    grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
}

.vendor-schedule-times > div, .vendor-delivery-day-settings > div {
    min-width: 0;
}

.vendor-schedule-times input[type="time"], .vendor-delivery-day-settings input[type="time"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    -webkit-min-logical-width: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.vendor-nav {
    top: 88px;
}

.display-none-mobile {
    display: none !important;
}

.vendor-nav-mobile-links .vendor-nav-group {
    width: 100%;
}

.vendor-nav-mobile-links .vendor-nav-group > summary {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
}

.vendor-nav-mobile-links .vendor-nav-submenu {
    position: static;

    margin-top: 6px;
    padding: 6px 0 0 14px;

    background: transparent;
    box-shadow: none;
}

/* From original lines 1358-1439 */

.vendor-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.vendor-nav-brand {
    margin-bottom: 0;
}


/* Hide desktop links */

.vendor-nav-desktop {
    display: none;
}


/* Show hamburger */

.vendor-nav-mobile {
    display: block;
    position: relative;
    margin-left: 10px;
}

.vendor-nav-toggle {
    padding: 8px 12px;

    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 7px;

    background: rgba(255, 255, 255, 0.12);
    color: white;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;
    list-style: none;
}

.vendor-nav-toggle::-webkit-details-marker {
    display: none;
}


/* Dropdown */

.vendor-nav-mobile-links {
    position: absolute;
    top: 48px;
    right: 0;

    display: flex;
    flex-direction: column;
    gap: 8px;

    width: 220px;
    padding: 10px;

    max-height: calc(100dvh - 70px);
    overflow-y: auto;

    background: #315b3a;
    border-radius: 8px;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.vendor-nav-mobile-links a,
.vendor-nav-mobile-links button {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
}

.vendor-nav-mobile-links form {
    width: 100%;
}

/* From original lines 1638-1647 */
.order-edit-description {
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
}

.order-edit-row {
    align-items: flex-start;
}

/* From original lines 2934-2954 */

.order-filter form {
    display: block;
}

.order-filter-field,
.order-filter-customer {
    width: 100%;
    max-width: none;
    margin-bottom: 12px;
}

.order-filter-actions {
    margin-top: 12px;
}

/* =========================================================
   ORDER LIST - PHONE
   ========================================================= */

.order-table-wrapper {
    width: 100%;
    overflow-x: hidden;
}

.order-table {
    width: 100%;
    min-width: 0;
}

.order-table thead {
    display: table-header-group;
}

.order-table tbody {
    display: table-row-group;
}

.order-table tr {
    display: table-row;
}

.order-table th,
.order-table td {
    display: table-cell;
    width: auto;
    padding: 6px 4px;
    box-sizing: border-box;
}

.order-table tbody tr {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
}

.order-table-id {
    width: auto !important;
    white-space: nowrap;
}

.order-table-customer {
    min-width: 0;
}

.order-payment-status {
    font-size: 0.7rem;
    padding: 2px 4px;
}

.order-status {
    font-size: 0.7rem;
}

.payment-history-date {
    text-align: left;
    margin-bottom: 6px;
}

.payment-history-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Phone landscape - from original lines 435-484 */
@media (orientation: landscape) {

    .inventory-portrait {
        display: none;
    }

    .inventory-landscape {
        display: block;
    }

    .inventory-landscape-header,
    .inventory-landscape-row {
        display: grid;
        grid-template-columns:
                minmax(150px, 2fr)
                75px
                45px
                45px
                50px
                45px
                45px;
        align-items: center;
        gap: 0.35rem;
        padding: 0.55rem 0.65rem;
    }

    .inventory-landscape-header {
        font-weight: 700;
        border-bottom: 1px solid #ccc;
    }

    .inventory-landscape-row {
        border-bottom: 1px solid #ddd;
    }

    .inventory-landscape-row:nth-child(even) {
        background: rgba(0, 0, 0, 0.04);
    }

    .inventory-landscape-name {
        font-weight: 600;
        min-width: 0;
    }

    .inventory-landscape-number,
    .inventory-landscape-action {
        text-align: center;
        white-space: nowrap;
    }
}

/* Phone landscape - from original lines 665-687 */
@media (orientation: landscape) {

    .inventory-report-header,
    .inventory-report-row {
        grid-template-columns:
                minmax(0, 1fr)
                85px
                145px
                44px
                44px
                48px;
    }

    .inventory-report-price,
    .inventory-report-updated {
        display: block;
        white-space: nowrap;
    }

    .inventory-report-updated {
        font-size: 0.9rem;
    }
}

/* Phone landscape - from original lines 1490-1501 */
@media (orientation: landscape) {

    .order-item-row {
        -webkit-text-size-adjust: none;
        text-size-adjust: none;
    }

    .order-item-description,
    .order-item-price {
        font-size: 1rem;
    }
}

/* Order list filter on phones */
.order-filter {
    margin-bottom: 18px;
}

.order-filter .field-label {
    margin-top: 10px;
    margin-bottom: 4px;
}

.order-filter .field-label:first-child {
    margin-top: 0;
}

.order-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.order-filter-actions .button {
    flex: 1;
    text-align: center;
}

.inventory-label-desktop {
    display: none;
}

.inventory-label-mobile {
    display: inline;
}

.inventory-label-desktop {
    display: none;
}

.inventory-label-mobile {
    display: inline;
}

.delivery-tax-rate-form {
    max-width: none;
}

.delivery-tax-rate-table {
    max-width: none;
}

.text-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}


.herd-filter-animal {
    display: block;
    width: 100%;
}

.herd-animal-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.herd-filter-animal[hidden] {
    display: none !important;
}

#herdTable_wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

#herdTable {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* =========================================================
   PROCESSING OVERLAY
   ========================================================= */
.processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.55);
}

.processing-overlay[hidden] {
    display: none;
}

.processing-box {
    width: 100%;
    max-width: 320px;
    padding: 26px 20px;

    background: white;
    border-radius: 10px;

    text-align: center;
}

.processing-spinner {
    width: 46px;
    height: 46px;

    margin: 0 auto 18px;

    border: 5px solid #dddddd;
    border-top-color: #333333;
    border-radius: 50%;

    animation: processing-spin 0.8s linear infinite;
}

.processing-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.processing-message {
    margin-top: 8px;
    font-size: 0.9rem;
}

body.processing {
    overflow: hidden;
}

@keyframes processing-spin {
    to {
        transform: rotate(360deg);
    }
}

