/**
 * Kiosk Styles - Tully's Corner Branded
 * Standalone tablet-optimized layout with thumb-friendly touch targets
 */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;500;600;700&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto Slab', Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.5;
    color: #293933;
    background: #f9f9fb;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ---- Login Page ---- */
.kiosk-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #001f12 0%, #003821 50%, #13612e 100%);
}

.kiosk-login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.kiosk-login-card {
    background: #fff;
    border-radius: 24px;
    padding: 48px 36px;
    box-shadow: 0 20px 60px rgba(0, 20, 10, 0.35);
    text-align: center;
}

.kiosk-logo {
    max-width: 240px;
    max-height: 120px;
    margin-bottom: 24px;
    object-fit: contain;
}

.kiosk-site-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #003821;
}

.kiosk-login-card h2 {
    font-size: 20px;
    color: #5a6b62;
    margin-bottom: 32px;
    font-weight: 400;
}

/* ---- Forms ---- */
.kiosk-form {
    text-align: left;
}

.kiosk-field {
    margin-bottom: 20px;
}

.kiosk-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #293933;
    margin-bottom: 6px;
}

.kiosk-field input,
.kiosk-field select {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    font-family: 'Roboto Slab', Georgia, serif;
    border: 2px solid #d4d9d6;
    border-radius: 12px;
    background: #fff;
    color: #1b1c1b;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    min-height: 52px;
}

.kiosk-field select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23293933' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.kiosk-field input:focus,
.kiosk-field select:focus {
    outline: none;
    border-color: #003821;
    box-shadow: 0 0 0 3px rgba(0, 56, 33, 0.12);
}

/* ---- Buttons ---- */
.kiosk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Roboto Slab', Georgia, serif;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.kiosk-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kiosk-btn-primary {
    background: #003821;
    color: #fff;
}

.kiosk-btn-primary:hover:not(:disabled) {
    background: #13612e;
}

.kiosk-btn-primary:active:not(:disabled) {
    background: #001f12;
}

.kiosk-btn-secondary {
    background: #e8ede9;
    color: #293933;
}

.kiosk-btn-secondary:hover:not(:disabled) {
    background: #d4d9d6;
}

.kiosk-btn-full {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    min-height: 56px;
}

/* ---- Error ---- */
.kiosk-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid #fecaca;
}

/* ---- Header ---- */
.kiosk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #003821;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 64px;
}

.kiosk-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kiosk-header-logo {
    height: 52px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
}

.kiosk-store-name {
    font-size: 20px;
    font-weight: 700;
    color: #f6e25d;
}

.kiosk-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kiosk-btn-cart {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    width: 52px;
    height: 52px;
    padding: 0;
    color: #fff;
    min-height: 52px;
}

.kiosk-btn-cart:hover {
    background: rgba(255, 255, 255, 0.25);
}

.kiosk-btn-cart #kiosk-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f6e25d;
    color: #003821;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.kiosk-btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 10px;
    min-height: 44px;
}

.kiosk-btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ---- Body Layout ---- */
.kiosk-body {
    display: flex;
    height: calc(100vh - 64px);
}

/* ---- Sidebar ---- */
.kiosk-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e2e7e4;
    overflow-y: auto;
    flex-shrink: 0;
}

.kiosk-search {
    padding: 16px;
    border-bottom: 1px solid #e2e7e4;
}

.kiosk-search input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Roboto Slab', Georgia, serif;
    border: 2px solid #e2e7e4;
    border-radius: 10px;
    background: #f4f6f5;
    min-height: 48px;
}

.kiosk-search input:focus {
    outline: none;
    border-color: #003821;
    background: #fff;
}

.kiosk-categories {
    padding: 10px;
}

.kiosk-cat-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Roboto Slab', Georgia, serif;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #293933;
    transition: all 0.15s;
    min-height: 50px;
    line-height: 1.3;
    gap: 8px;
    margin-bottom: 2px;
}

.kiosk-cat-btn:hover {
    background: #f0f4f1;
}

.kiosk-cat-btn.active {
    background: #003821;
    color: #fff;
}

.kiosk-cat-btn.active .kiosk-cat-count {
    background: rgba(246, 226, 93, 0.25);
    color: #f6e25d;
}

.kiosk-cat-count {
    font-size: 12px;
    font-weight: 600;
    background: #e8ede9;
    color: #5a6b62;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ---- Main: Product Grid ---- */
.kiosk-main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f4f6f5;
}

.kiosk-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.kiosk-loading,
.kiosk-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #7a8a82;
    font-size: 18px;
}

.kiosk-product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 30, 18, 0.06);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.kiosk-product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 30, 18, 0.1);
    transform: translateY(-1px);
}

.kiosk-product-card.kiosk-out-of-stock {
    opacity: 0.5;
}

.kiosk-product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f4f1;
}

.kiosk-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kiosk-product-info {
    padding: 14px 16px;
    flex: 1;
}

.kiosk-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #1b1c1b;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.kiosk-product-price {
    font-size: 17px;
    font-weight: 700;
    color: #003821;
}

.kiosk-btn-add {
    margin: 0 14px 14px;
    padding: 12px;
    font-size: 15px;
    background: #003821;
    color: #fff;
    border-radius: 10px;
    min-height: 48px;
}

.kiosk-btn-add:hover:not(:disabled) {
    background: #13612e;
}

.kiosk-btn-add:active:not(:disabled) {
    background: #001f12;
}

.kiosk-load-more {
    text-align: center;
    padding: 24px;
}

/* ---- Cart Panel ---- */
.kiosk-cart-panel {
    width: 360px;
    background: #fff;
    border-left: 1px solid #e2e7e4;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    position: fixed;
    right: 0;
    top: 64px;
    bottom: 0;
    z-index: 50;
}

.kiosk-cart-panel.open {
    transform: translateX(0);
}

.kiosk-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e7e4;
}

.kiosk-cart-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #003821;
}

.kiosk-btn-close {
    background: #f0f4f1;
    font-size: 24px;
    color: #5a6b62;
    padding: 0;
    width: 44px;
    height: 44px;
    line-height: 1;
    border-radius: 10px;
    min-height: 44px;
}

.kiosk-btn-close:hover {
    background: #e2e7e4;
    color: #293933;
}

.kiosk-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}

.kiosk-cart-empty {
    text-align: center;
    color: #7a8a82;
    padding: 32px 0;
}

.kiosk-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f4f1;
}

.kiosk-cart-item-img {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.kiosk-cart-item-info {
    flex: 1;
    min-width: 0;
}

.kiosk-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1b1c1b;
}

.kiosk-cart-item-price {
    font-size: 13px;
    color: #5a6b62;
    margin-top: 2px;
}

.kiosk-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kiosk-qty-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f0f4f1;
    border: none;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #293933;
    min-height: 44px;
}

.kiosk-qty-btn:hover {
    background: #e2e7e4;
}

.kiosk-qty-btn:active {
    background: #d4d9d6;
}

.kiosk-cart-item-qty span {
    font-size: 16px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.kiosk-cart-item-remove {
    background: transparent;
    border: none;
    font-size: 22px;
    color: #c5ccc8;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    min-height: 44px;
}

.kiosk-cart-item-remove:hover {
    color: #b91c1c;
    background: #fef2f2;
}

.kiosk-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 2px solid #003821;
    font-size: 20px;
    color: #003821;
    flex-shrink: 0;
}

.kiosk-cart-panel > .kiosk-btn-primary {
    margin: 0 20px calc(20px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
}

/* ---- Modals ---- */
.kiosk-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 20, 10, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
}

.kiosk-modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 20, 10, 0.25);
}

.kiosk-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f0f4f1;
    border: none;
    font-size: 24px;
    color: #5a6b62;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.kiosk-modal-close:hover {
    background: #e2e7e4;
    color: #293933;
}

.kiosk-modal-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-right: 40px;
    color: #003821;
}

.kiosk-modal-quantity {
    margin-top: 16px;
}

.kiosk-modal-quantity label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #293933;
}

.kiosk-qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kiosk-qty-controls .kiosk-btn {
    width: 52px;
    height: 52px;
    font-size: 24px;
    font-weight: 700;
    padding: 0;
    background: #f0f4f1;
    border-radius: 12px;
    color: #293933;
    min-height: 52px;
}

.kiosk-qty-controls .kiosk-btn:hover {
    background: #e2e7e4;
}

.kiosk-qty-controls .kiosk-btn:active {
    background: #d4d9d6;
}

.kiosk-qty-controls input {
    width: 70px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    font-family: 'Roboto Slab', Georgia, serif;
    padding: 10px;
    border: 2px solid #d4d9d6;
    border-radius: 12px;
    min-height: 52px;
}

.kiosk-qty-controls input:focus {
    outline: none;
    border-color: #003821;
}

.kiosk-modal-price {
    font-size: 22px;
    font-weight: 700;
    color: #003821;
    margin: 16px 0;
    min-height: 30px;
}

.kiosk-modal-content > .kiosk-btn-primary {
    margin-top: 16px;
}

/* ---- Checkout Summary ---- */
.kiosk-checkout-summary {
    background: #f0f4f1;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    border-left: 4px solid #003821;
}

.kiosk-checkout-summary p {
    margin-bottom: 6px;
    font-size: 15px;
    color: #293933;
}

.kiosk-checkout-summary p:last-child {
    margin-bottom: 0;
}

/* ---- Confirmation ---- */
.kiosk-confirmation {
    text-align: center;
}

.kiosk-confirmation-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #003821;
    color: #f6e25d;
    font-size: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.kiosk-confirmation h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #003821;
}

.kiosk-confirmation p {
    font-size: 20px;
    color: #5a6b62;
    margin-bottom: 28px;
}

/* ---- Variation attribute selects in modal ---- */
.kiosk-modal-content select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: 'Roboto Slab', Georgia, serif;
    border: 2px solid #d4d9d6;
    border-radius: 12px;
    background: #fff;
    color: #1b1c1b;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23293933' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    min-height: 52px;
    margin-bottom: 12px;
}

.kiosk-modal-content select:focus {
    outline: none;
    border-color: #003821;
    box-shadow: 0 0 0 3px rgba(0, 56, 33, 0.12);
}

.kiosk-modal-content label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #293933;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .kiosk-sidebar {
        position: fixed;
        left: 0;
        top: 64px;
        bottom: 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .kiosk-sidebar.open {
        transform: translateX(0);
    }

    .kiosk-products {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 12px;
    }

    .kiosk-cart-panel {
        width: 100%;
    }
}

@media (min-width: 1200px) {
    .kiosk-cart-panel {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
    }

    .kiosk-cart-panel.open {
        transform: none;
    }
}
