/* TorFoods v1.1 UI Polish — EMBER Design System
   Applies to all v1.1-shipped customer UI: tip selector, postcode lookup,
   push notifications card, cookie banner, reorder/cancel buttons.
*/

:root {
    --tf-primary: #e85d04;
    --tf-primary-dark: #c44d03;
    --tf-primary-soft: #fff7ed;
    --tf-primary-glow: rgba(232, 93, 4, 0.15);
    --tf-success: #16a34a;
    --tf-success-soft: #d1fae5;
    --tf-success-text: #065f46;
    --tf-error: #dc2626;
    --tf-error-soft: #fee2e2;
    --tf-error-text: #991b1b;
    --tf-warn: #f59e0b;
    --tf-warn-soft: #fef3c7;
    --tf-warn-text: #78350f;
    --tf-text: #111827;
    --tf-muted: #6b7280;
    --tf-border: #e5e7eb;
    --tf-bg: #f9fafb;
    --tf-radius: 14px;
    --tf-shadow-sm: 0 1px 2px rgba(0,0,0,.04);
    --tf-shadow:    0 2px 8px rgba(0,0,0,.06);
    --tf-shadow-lg: 0 8px 24px rgba(0,0,0,.08);
}

/* ================================================================
   1. TIP SELECTOR (checkout.php)
================================================================ */
.tf-tip-section {
    background: linear-gradient(135deg, #fff 0%, var(--tf-primary-soft) 100%);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 22px;
    margin: 18px 0;
}
.tf-tip-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
}
.tf-tip-header .icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--tf-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.tf-tip-header h3 {
    margin: 0; font-size: 16px; font-weight: 700; color: var(--tf-text);
    font-family: 'DM Sans', sans-serif;
}
.tf-tip-header .sub {
    font-size: 12px; color: var(--tf-muted); margin-top: 2px;
}

.tf-tip-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.tf-tip-btn {
    padding: 14px 10px;
    border-radius: 10px;
    background: #fff;
    border: 2px solid var(--tf-border);
    font-weight: 700;
    font-size: 15px;
    color: var(--tf-text);
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    min-height: 50px;
    display: flex; align-items: center; justify-content: center;
}
.tf-tip-btn:hover {
    border-color: var(--tf-primary);
    color: var(--tf-primary);
    transform: translateY(-1px);
}
.tf-tip-btn.active {
    background: var(--tf-primary);
    color: #fff;
    border-color: var(--tf-primary);
    box-shadow: 0 4px 12px var(--tf-primary-glow);
}
.tf-tip-btn .pct { font-size: 18px; }
.tf-tip-btn .amt { font-size: 11px; opacity: .8; margin-top: 2px; font-weight: 500; }
.tf-tip-btn.active .amt { opacity: 1; }

.tf-tip-custom {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--tf-border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    margin-top: 8px;
}
.tf-tip-custom:focus {
    outline: none;
    border-color: var(--tf-primary);
    box-shadow: 0 0 0 3px var(--tf-primary-glow);
}
.tf-tip-note {
    font-size: 12px;
    color: var(--tf-muted);
    margin: 10px 0 0;
    display: flex; align-items: center; gap: 6px;
}
.tf-tip-note i { color: var(--tf-success); }

/* ================================================================
   2. POSTCODE LOOKUP (checkout.php)
================================================================ */
.tf-postcode-row {
    display: flex; gap: 8px; align-items: stretch;
}
.tf-postcode-row input[type=text] {
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.tf-postcode-btn {
    padding: 0 18px;
    background: var(--tf-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .15s;
    min-height: 48px;
    font-family: inherit;
}
.tf-postcode-btn:hover { background: var(--tf-primary-dark); }
.tf-postcode-btn:disabled { opacity: .6; cursor: wait; }
.tf-postcode-status {
    display: flex; align-items: center; gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    background: transparent;
    transition: background .2s;
}
.tf-postcode-status.success {
    background: var(--tf-success-soft);
    color: var(--tf-success-text);
}
.tf-postcode-status.error {
    background: var(--tf-error-soft);
    color: var(--tf-error-text);
}
.tf-postcode-status.info {
    background: var(--tf-warn-soft);
    color: var(--tf-warn-text);
}

/* ================================================================
   3. CUSTOMER PUSH NOTIFICATIONS CARD (account/index.php)
================================================================ */
.cust-push-card {
    background: linear-gradient(135deg, #fff 0%, var(--tf-primary-soft) 100%);
    border: 1px solid var(--tf-border);
    border-radius: var(--tf-radius);
    padding: 24px;
    box-shadow: var(--tf-shadow);
    display: flex; flex-direction: column; gap: 16px;
    position: relative;
    overflow: hidden;
}
.cust-push-card::before {
    content: '';
    position: absolute; top: -40px; right: -40px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, var(--tf-primary-glow) 0%, transparent 70%);
    pointer-events: none;
}
.cust-push-head { display: flex; gap: 14px; align-items: flex-start; position: relative; }
.cust-push-head .bell-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--tf-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--tf-primary-glow);
}
.cust-push-head h3 {
    margin: 0 0 4px;
    font-size: 18px; font-weight: 700;
    color: var(--tf-text);
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.cust-push-head p {
    margin: 0;
    color: var(--tf-muted);
    font-size: 14px;
    line-height: 1.5;
}
.cust-push-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 0.5px;
    vertical-align: middle;
}
.cust-push-badge.on  {
    background: var(--tf-success-soft);
    color: var(--tf-success-text);
}
.cust-push-badge.on::before {
    content: '●'; color: var(--tf-success); animation: tfPulse 1.5s infinite;
}
.cust-push-badge.off {
    background: var(--tf-error-soft);
    color: var(--tf-error-text);
}
@keyframes tfPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.cust-push-status {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.cust-push-status.success { background: var(--tf-success-soft); color: var(--tf-success-text); }
.cust-push-status.error   { background: var(--tf-error-soft); color: var(--tf-error-text); }
.cust-push-status.info    { background: var(--tf-warn-soft); color: var(--tf-warn-text); }

.cust-push-actions {
    display: flex; gap: 10px; flex-wrap: wrap;
}
.cust-push-actions button {
    flex: 1; min-width: 130px;
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .15s;
    font-family: inherit;
    min-height: 46px;
}
.cust-push-actions .cpb-primary {
    background: var(--tf-primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--tf-primary-glow);
}
.cust-push-actions .cpb-primary:hover {
    background: var(--tf-primary-dark);
    transform: translateY(-1px);
}
.cust-push-actions .cpb-outline {
    background: #fff;
    color: var(--tf-text);
    border: 1px solid var(--tf-border);
}
.cust-push-actions .cpb-outline:hover {
    background: var(--tf-bg);
    border-color: var(--tf-muted);
}

/* ================================================================
   4. COOKIE CONSENT BANNER
================================================================ */
#tf-cookie-banner {
    position: fixed; left: 16px; right: 16px; bottom: 16px;
    z-index: 9999;
    background: linear-gradient(135deg, #1a1d27 0%, #2a2e3b 100%);
    color: #f3f4f6;
    padding: 18px 22px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    border: 1px solid rgba(255,255,255,.06);
    animation: tfCkSlide .4s cubic-bezier(.2,.8,.4,1);
    max-width: 1100px; margin: 0 auto;
}
@keyframes tfCkSlide {
    from { transform: translateY(120%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.tf-ck-inner {
    display: flex; align-items: center; gap: 20px;
    flex-wrap: wrap;
}
.tf-ck-text {
    flex: 1; min-width: 240px;
    font-size: 14px; line-height: 1.55;
    display: flex; align-items: flex-start; gap: 14px;
}
.tf-ck-text::before {
    content: '🍪';
    font-size: 28px; flex-shrink: 0;
    margin-top: -2px;
}
.tf-ck-text a {
    color: #fb923c;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.tf-ck-text a:hover { color: #fdba74; }
.tf-ck-actions { display: flex; gap: 10px; flex-shrink: 0; }
.tf-ck-actions button {
    padding: 11px 22px;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    min-height: 42px;
    transition: all .15s;
    font-family: inherit;
}
.tf-ck-decline {
    background: transparent;
    color: #d1d5db;
    border: 1px solid rgba(255,255,255,.18) !important;
}
.tf-ck-decline:hover {
    color: #fff;
    border-color: rgba(255,255,255,.4) !important;
}
.tf-ck-accept {
    background: var(--tf-primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--tf-primary-glow);
}
.tf-ck-accept:hover {
    background: var(--tf-primary-dark);
    transform: translateY(-1px);
}

/* ================================================================
   5. ORDER DETAIL ACTION BUTTONS (Reorder, Cancel)
================================================================ */
.btn-reorder-lg, .btn-cancel-lg {
    padding: 12px 22px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all .15s !important;
    border: none !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center; gap: 8px;
    min-height: 44px;
    font-family: inherit;
}
.btn-reorder-lg {
    background: var(--tf-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px var(--tf-primary-glow);
}
.btn-reorder-lg:hover {
    background: var(--tf-primary-dark) !important;
    transform: translateY(-1px);
}
.btn-cancel-lg {
    background: var(--tf-error-soft);
    color: var(--tf-error-text);
}
.btn-cancel-lg:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* ================================================================
   6. SECTION HEADERS (consistent across all v1.1 sections)
================================================================ */
.tf-section-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 16px; font-weight: 700;
    color: var(--tf-text);
    margin: 0 0 14px;
}
.tf-section-title i {
    color: var(--tf-primary);
    font-size: 18px;
}

/* ================================================================
   MOBILE TWEAKS
================================================================ */
@media (max-width: 600px) {
    .tf-tip-row { grid-template-columns: repeat(3, 1fr); }
    .tf-tip-btn { padding: 12px 6px; font-size: 13px; }
    .tf-postcode-row { flex-direction: column; }
    .tf-postcode-btn { width: 100%; }
    .cust-push-actions button { min-width: 100%; }
    #tf-cookie-banner { padding: 16px 18px; left: 8px; right: 8px; bottom: 8px; border-radius: 14px; }
    .tf-ck-actions { width: 100%; }
    .tf-ck-actions button { flex: 1; }
}
