/* ============================================
   stock_out.php - iOS Style CSS
   ============================================ */

:root {
    --primary-color: #007AFF;
    /* iOS Blue */
    --secondary-color: #8E8E93;
    /* iOS Gray */
    --success-color: #34C759;
    /* iOS Green */
    --danger-color: #FF3B30;
    /* iOS Red */
    --warning-color: #FF9500;
    /* iOS Orange */
    --background-color: #F2F2F7;
    /* iOS Grouped Background */
    --card-bg: #FFFFFF;
    --card-radius: 16px;
    --btn-radius: 12px;
    --font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --safe-area-top: env(safe-area-inset-top, 20px);
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

html,
body {
    height: 100%;
    overflow: hidden;
    /* Strictly prevent page scroll */
    background-color: var(--background-color);
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    color: #000;
    overscroll-behavior-y: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Card Styling */
.card {
    border: none;
    border-radius: var(--card-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    background: var(--card-bg);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.card:active {
    transform: scale(0.995);
}

/* Buttons */
.btn {
    border-radius: var(--btn-radius);
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 0.75rem 1.5rem;
    transition: all 0.1s ease;
}

.btn:active {
    transform: scale(0.96);
    opacity: 0.8;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    background-color: #0066d6;
    border-color: #0066d6;
    transform: translateY(-1px);
}

/* Inputs */
.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid #E5E5EA;
    padding: 0.8rem 1rem;
    font-size: 17px;
    /* iOS default size */
    background-color: rgba(118, 118, 128, 0.12);
    /* iOS Search Bar bg */
    border: none;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

/* Inventory Cards */
.inventory-card {
    border-radius: var(--card-radius);
    border: 1px solid transparent;
    background: #fff;
}

.inventory-card.selected {
    background-color: #F0F8FF;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color) inset;
}

/* Cart Item Styling */
.cart-item-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-item-card:active {
    transform: scale(0.98);
}

.btn-remove-from-cart {
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn-remove-from-cart:hover {
    opacity: 1 !important;
}

.btn-remove-from-cart:active {
    transform: scale(0.9);
}

/* Layout & Scroll */
.layout-container {
    height: 100dvh;
    overflow: hidden;
    padding-top: var(--safe-area-top);
    padding-bottom: 0;
}

.custom-scrollbar {
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px !important;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Header */
.app-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Modal Fullscreen on Mobile/Tablet */
@media (max-width: 1199.98px) {
    .modal-fullscreen-md-down .modal-dialog {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        max-width: none;
    }

    .modal-fullscreen-md-down .modal-content {
        height: 100%;
        border-radius: 0;
        border: none;
    }
}

/* Bottom Sheet Modal (Mobile/Tablet) */
@media (max-width: 991.98px) {
    .modal.fade:not(#productSearchModal) .modal-dialog {
        transform: translate(0, 100%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .modal.show:not(#productSearchModal) .modal-dialog {
        transform: translate(0, 0);
    }

    .modal-dialog:not(.modal-fullscreen-md-down) {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        max-width: 100%;
        height: auto;
    }

    .modal-content:not(.modal-fullscreen-md-down .modal-content) {
        border-radius: 24px 24px 0 0;
        border: none;
        padding-bottom: var(--safe-area-bottom);
    }

    .modal-drag-handle {
        width: 40px;
        height: 5px;
        background-color: #E5E5EA;
        border-radius: 100px;
        margin: 12px auto;
    }
}

@media (min-width: 992px) {
    .mobile-bottom-bar {
        display: none !important;
    }

    .modal-drag-handle {
        display: none;
    }

    .layout-container {
        height: 100dvh;
        overflow: hidden;
        padding-top: var(--safe-area-top);
        padding-bottom: 0;
        box-sizing: border-box;
    }
}

/* Fixed Checkout Footer */
#checkout-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

@media (min-width: 768px) {
    #checkout-footer {
        left: 17rem;
        /* Sidebar width */
        width: calc(100% - 17rem);
        transition: all 0.25s ease-out;
    }

    body.sb-sidenav-toggled #checkout-footer {
        left: 0;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    #checkout-footer {
        left: 0;
        width: 100%;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    }
}/* Utility Classes for Cards */
.hover-shadow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.transition-all {
    transition: all 0.2s ease-in-out;
}

/* Modal sizing tweak for iPad Landscape */
@media (min-width: 992px) {
    .modal-lg {
        max-width: 900px;
        /* Slightly wider than default 800px */
    }
}