/*
Theme Name: Therapists Hadigitalim
Theme URI: https://example.com
Author: Intellinet
Description: Premium Medical Portal with WooCommerce Integration
Version: 1.0.0
Text Domain: tph
*/

/* ========================================
   TABLE OF CONTENTS
======================================== */
/*
1. Font Imports & Variables
2. Reset & Base Styles
3. Typography
4. Layout & Grid System
5. Navigation
6. Cards & Components
7. Forms & Inputs
8. Buttons & Badges
9. Tables
10. Authentication (Login)
11. WooCommerce Integration
12. Prescription Forms
13. Product Grid & Tabs
14. Utilities & Animations
15. Media Queries
*/

/* ========================================
   1. FONT IMPORTS & VARIABLES
======================================== */
@font-face {
    font-family: 'Open Sans Hebrew';
    src: url('assets/fonts/OpenSans-VariableFont_wdth,wght.ttf') format('truetype-variations');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Colors - Light Theme */
    --bg-primary: #fafbfc;
    --bg-secondary: #f8f9fa;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-accent: #f0f4ff;
    --bg-overlay: rgba(0, 0, 0, 0.1);

    /* Borders */
    --border-primary: rgba(110, 139, 255, 0.3);
    --border-secondary: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.05);
    --border-hover: rgba(110, 139, 255, 0.5);

    /* Brand Colors */
    --brand: #fff;
    --brand-dark: #4e4869;
    --brand-light: #bed9e436;
    --brand-glow: rgba(110, 139, 255, 0.2);
    --btn-primary: #1e98a5;

    /* Semantic Colors */
    --accent: #50486c;
    --accent-light: #22d2b3;
    --success: #00b894;
    --success-light: #e6f7f1;
    --warning: #fdcb6e;
    --warning-light: #fef7e6;
    --danger: #e17055;
    --danger-light: #fdf2ef;

    /* Text Colors */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;
    --text-white: #ffffff;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(110, 139, 255, 0.1);
    --shadow-focus: 0 0 0 4px rgba(110, 139, 255, 0.1);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Legacy support */
    --border-radius: var(--radius-2xl);
    --border-radius-lg: var(--radius-xl);

    /* Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-fam: 'Open Sans Hebrew', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    --font-size-4xl: 36px;

    /* Layout */
    --navbar-height: 95px;
    --container-max-width: 1500px;
    --sidebar-width: 280px;

    /* Z-index scale */
    --z-dropdown: 1000;
    --z-sticky: 1010;
    --z-fixed: 1020;
    --z-modal-backdrop: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}

/* ========================================
   2. RESET & BASE STYLES
======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    font-family: var(--font-fam);
    font-size: var(--font-size-base);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Improved scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection styling */
::selection {
    background-color: var(--brand-glow);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: var(--brand-glow);
    color: var(--text-primary);
}

/* ========================================
   3. TYPOGRAPHY
======================================== */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.h1, h1 {
    font-size: clamp(var(--font-size-2xl), 4vw, var(--font-size-4xl));
    font-weight: 900;
}

.h2, h2 {
    font-size: clamp(var(--font-size-xl), 3vw, var(--font-size-2xl));
    font-weight: 700;
}

.h3, h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.h4, h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.d-none {
    display: none;
}

p {
    margin: 0 0 1rem;
    line-height: 1.7;
}

a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

a:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Link hover effects */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-dark);
    transition: var(--transition);
}

.link-underline:hover::after {
    width: 100%;
}

ul {
    list-style:none;
}

ul#menu-primary {
    display: flex;
    gap:0.5rem;
}


/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }

/* ========================================
   4. LAYOUT & GRID SYSTEM
======================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.container--narrow {
    max-width: 800px;
}

.container--wide {
    max-width: 1600px;
}

/* Flexbox utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Grid System */
.grid {
    display: grid;
    gap: 1.25rem;
    justify-content: center;
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid--auto {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-span-2 {
    grid-column: span 2;
}

.grid-span-3 {
    grid-column: span 3;
}

.grid-row-2 {
    grid-row: span 2;
}

/* Legacy grid support */
.tph-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.tph-grid-2 .grid-span-2 {
    grid-column: 1 / -1;
}

/* ========================================
   5. NAVIGATION
======================================== */
.header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.3;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    position: relative;
    min-height: var(--navbar-height);
}

.nav.logged-out .nav__menu{
    justify-content: flex-end;
}

.nav__brand {
    font-weight: 700;
    font-size: var(--font-size-xl);
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

.nav__brand:hover {
    transform: scale(1.05);
}

.nav__menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav__menu a {
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    font-weight: 500;
    font-size: var(--font-size-md);
}

.nav__menu a:hover,
.nav__menu a.active {
    background: var(--brand-light);
    color: var(--brand-dark);
    transform: translateY(-1px);
}

.nav__menu a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--brand);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav__menu a:hover::before,
.nav__menu a.active::before {
    width: 80%;
}

/* Mobile menu toggle */
.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav__toggle:hover {
    background: var(--brand-light);
}


/* תא הפעולות משמש עוגן למיקום */
.rx-actions-cell { position: relative; }

/* כפתור שלוש הנקודות */
.rx-kebab {
    display:inline-flex; align-items:center; justify-content:center;
    width:28px; height:28px; border-radius:6px; border:0; background:transparent; cursor:pointer;
}
.rx-kebab .dot { width:4px; height:4px; border-radius:50%; background:currentColor; margin:0 1px; opacity:.85; }

/* התפריט עצמו – מוסתר כברירת מחדל ונחשף כש-aria-hidden="false" */
.rx-menu {
    position:absolute; top:100%; margin-top:6px;
    min-width:150px; background:#fff; border:1px solid #e5e7eb; border-radius:8px;
    box-shadow:0 6px 18px rgba(0,0,0,.08); padding:6px; display:none; z-index:50;
}
.rx-menu[aria-hidden="false"] { display:block; }
.rx-menu a[role="menuitem"] {
    display:block; padding:8px 10px; border-radius:6px; text-decoration:none; color:#111827;
}
.rx-menu a[role="menuitem"]:hover { background:#f3f4f6; }


/* ========================================
   6. CARDS & COMPONENTS
======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0;
    transition: var(--transition);
}



/* Card variants */
.card--elevated {
    box-shadow: var(--shadow-lg);
}

.card--interactive {
    cursor: pointer;
    user-select: none;
}

.card--interactive:active {
    transform: translateY(-1px) scale(0.98);
}

.card--glass {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dashboard specific cards */
.dashboard .card {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 200px;
}

/* Product cards */
.tph-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    height: 100%;
}

.tph-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.tph-card__media {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tph-card__svg {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tph-card__svg svg {
    width: 100%;
    height: 100%;
}

.tph-tab--active .tph-card__media svg path {
 fill: var(--brand);
}


.tph-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.tph-card:hover .tph-card__media img {
    transform: scale(1.05);
}

.tph-card__body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.tph-card__title {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.4;
}

.tph-card__price {
    color: var(--accent);
    font-weight: 700;
    font-size: var(--font-size-base);
}

.tph-card__vars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

/* Card input variants */
.tph-card-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tph-card-box {
    border: 2px solid var(--border-secondary);
    border-radius: 50%;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
    background: white;
    width: 6rem;
    height: 6rem;
}

.tph-card-box:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}


.tph-card-input:checked + .tph-card-box {
    background: var(--accent-light);
    box-shadow: 0 0 0 2px var(--accent-light) inset;
}

.tph-card-input:checked + .tph-card-box .tph-card__svg svg path {
    fill: var(--brand);
}

/* ========================================
   7. FORMS & INPUTS
======================================== */
.tph-input,
.tph-textarea,
.tph-select,
.tph-field {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    font-family: inherit;
    line-height: 1.5;
    transition: var(--transition);
}

.tph-textarea {
    resize: vertical;
    min-height: 120px;
}

.tph-select {
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' viewBox='0 0 14 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 3l5 5 5-5' stroke='%236e8bff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

/* RTL support for select */
.rtl .tph-select {
    background-position: left 1rem center;
    padding-left: 2.5rem;
    padding-right: 1rem;
}

/* Focus states */
.tph-input:focus,
.tph-textarea:focus,
.tph-select:focus,
.tph-field:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--shadow-focus);
    transform: translateY(-1px);
}

/* Placeholder styling */
.tph-input::placeholder,
.tph-textarea::placeholder,
.tph-field::placeholder {
    color: var(--text-light);
    opacity: 1;
}


/* Validation states */
.field-error,
.tph-input.field-error,
.tph-textarea.field-error,
.tph-select.field-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 4px rgba(225, 112, 85, 0.1) !important;
}

.field-success,
.tph-input.field-success,
.tph-textarea.field-success,
.tph-select.field-success {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.1) !important;
}

/* Form groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: bold;
}

.form-help {
    margin-top: 0.25rem;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* Checkbox and radio styling */
.checkbox,
.radio {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0;
}

.checkbox input,
.radio input {
    width: auto;
    margin: 0;
}

/* Autocomplete */
.tph-autocomplete {
    position: absolute;
    z-index: var(--z-dropdown);
    background: white;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow: auto;
    margin-top: 2px;
    list-style: none;
    padding: 0;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.2s ease-out;
}

.tph-table-price {
    display:none;
}

.tph-cart-box {
    border:1px solid #eee;border-radius:10px;padding:8px;max-height:420px;overflow:auto;text-align: right;
}

.js-rx-remove {
    border: none;
    background: none;
    cursor: pointer;
}

button.tph-remove-btn.tph-input {
    -webkit-appearance: none;
    appearance: none;
    background-color: #eee;      /* רק background-color, לא background */
    border: 1px solid red;
    border-radius: 50%;
    font-size: 22px;
    padding: 5px 15px;
    color: red;
    cursor: pointer;
    transition: linear 0.25s ease, color 0.25s ease;
}
button.tph-remove-btn.tph-input:hover {
    scale:1.05;
}


.tph-autocomplete li {
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.tph-autocomplete li:last-child {
    border-bottom: none;
}

.tph-autocomplete li:hover,
.tph-autocomplete li.highlighted {
    background: var(--bg-accent);
    color: var(--brand-dark);
}

/* ========================================
   8. BUTTONS & BADGES
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    padding: 0.75rem 1.25rem;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--font-size-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    background-color: var(--accent-light);
    text-decoration: none;
    user-select: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn:active {
    transform: translateY(0);
}

.btn:focus {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Button variants */
.btn--primary {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.btn--primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: white;
}

.btn--secondary {
    background: white;
    color: var(--brand);
    border-color: var(--brand);
}

.btn--secondary:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
}

.btn--success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn--warning {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}

.btn--danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.btn--ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Button sizes */
.btn--sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-xs);
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
}

.btn--xl {
    padding: 1.25rem 2.5rem;
    font-size: var(--font-size-xl);
}

/* Button states */
.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading {
    pointer-events: none;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-light);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    color: var(--btn-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.6s;
}

.badge:hover::before {
    left: 100%;
}

/* Badge variants */
.badge--success {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.badge--warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning);
}

.badge--danger {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.badge--accent {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* ========================================
   9. TABLES
======================================== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: white;
    margin: 1rem 0;
}

.table th,
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
    text-align: right;
}

.table th {
    background: var(--bg-accent);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: var(--font-size-xs);
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.formula_bottom {
    display: flex;
    justify-content: space-around;
    margin: 1.25rem 0;
    align-items: center;
}

.formula_save {
    display:flex;
    flex-direction: column;
    gap: 1rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--brand-light);
}

.table tbody tr:hover td {
    background: transparent;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Responsive table */
.table-responsive {
    overflow-x: auto;
    margin: 1rem 0;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   10. AUTHENTICATION (LOGIN)
======================================== */
.tph-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-image: url('https://therapists.hadigitalim.com/wp-content/uploads/2025/10/bgn.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position:bottom;
}

.tph-login-hero {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-direction:column;
    gap: 3rem;
    padding: 2rem;
    overflow: hidden;
}


.tph-login-hero .tph-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 525px;
}

.footer {
    text-align: center;
    font-size: 15px;
    color: #9b9b9b;
    margin-top: 2rem;
}

.container .tph-input {
    width: 100%;
}


.tph-login-hero .tph-signup {
    display:flex;
    justify-content: space-between;
    align-items: center;
}
.tph-login-title {
    font-size: clamp(1rem, 2vw, 2.5rem);
    margin: 4rem 0;
    font-weight:normal;
    color: var(--text-primary);
    position: relative;
}

.tph-login-form {
    max-width: 400px;
    margin: 0 auto;
    display: grid;
    gap: 1.5rem;
    direction: rtl;
    position: relative;
    z-index: 2;
}


.tph-login-hero .login-remember {
    margin: 0;
}

.tph-login-hero .tph-field {
    padding:0;
    margin-bottom:2rem;

}

.tph-login-hero p > label {
    position: absolute;
    opacity: 0.7;
    padding: 1rem;
    transition: var(--transition-slow);
    cursor: text;
    top: 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    pointer-events: none;
}

.tph-login-hero input {
    width: 100%;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    border: 2px solid var(--border-secondary);
    background: white;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.tph-login-hero input:focus {
    border-color: var(--brand);
    box-shadow: var(--shadow-focus);
    outline: none;
}

.tph-login-hero input:focus + label,
.tph-login-hero input:not(:placeholder-shown) + label {
    transform: translateY(-2.5rem);
    font-size: var(--font-size-xs);
    opacity: 1;
    color: var(--text-primary);
    font-weight: 600;
}

.tph-login-hero input[type="checkbox"] {
    width: fit-content;
    margin: 0;
}

.tph-login-hero .tph-field--inline {
    text-align: center;
}

.tph-login-hero label:has(input) {
    position: initial;
    opacity: 1;
    cursor: initial;
    display: flex;
    flex-direction: column;
    padding: 0;
    color: var(--text-secondary);
}

.tph-login-hero input[type="submit"] {
    background: linear-gradient(135deg, var(--brand-dark), var(--accent));
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.tph-login-hero input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--accent), var(--brand-dark));
}

.tph-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.tph-btn {
    border: none;
    border-radius: var(--radius-2xl);
    padding: 1rem 1.5rem;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: var(--font-size-base);
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.tph-btn.signup-btn {
    text-align:center;
    background: var(--accent-light);
}

.tph-links {
    margin-top: 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    display:flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    margin-bottom:2rem;
}


.tph-login-hero .tph-btn {
    width:50%;
    float:left;
}



.tph-links a {
    color: var(--brand-dark);
}



.tph-error {
    margin-top: 1rem;
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    padding: 1rem;
    animation: shake 0.5s ease-in-out;
    position: relative;
}

.tph-error::before {
    content: '⚠';
    margin-right: 0.5rem;
    font-weight: bold;
}

/* ========================================
   11. WOOCOMMERCE INTEGRATION
======================================== */
.woocommerce {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.woocommerce-account .woocommerce {
    display: flex;
    gap: 2rem;
    width: 100%;
    align-items: flex-start;
}

.woocommerce-MyAccount-navigation {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-secondary);
    flex: 0 0 var(--sidebar-width);
    position: sticky;
    top: calc(var(--navbar-height) + 2rem);
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.woocommerce-MyAccount-navigation ul li {
    margin: 0;
}

.woocommerce-MyAccount-navigation ul li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
    position: relative;
    font-size: var(--font-size-sm);
}

.woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-MyAccount-navigation ul li.is-active a {
    background: var(--brand-light);
    color: var(--brand-dark);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.woocommerce-MyAccount-navigation ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    background: var(--brand);
    border-radius: 0 2px 2px 0;
    transform: translateY(-50%);
    transition: var(--transition);
}

.woocommerce-MyAccount-navigation ul li.is-active a::before {
    height: 60%;
}

.woocommerce-MyAccount-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-secondary);
    min-height: 400px;
    flex: 1;
}

/* Orders Table */
.woocommerce-orders-table {
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
}

.woocommerce-orders-table__header,
.woocommerce-orders-table__row {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: var(--transition);
}

.woocommerce-orders-table__header {
    background: var(--bg-accent);
    font-weight: 600;
}

.woocommerce-orders-table__cell {
    padding: 1rem;
    border: none;
    background: transparent;
    font-size: var(--font-size-sm);
}

.woocommerce-orders-table__row:hover {
    background: var(--brand-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Order Status Badges */
.woocommerce-order-status {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woocommerce-order-status.status-completed {
    background: var(--success-light);
    color: var(--success);
}

.woocommerce-order-status.status-processing {
    background: var(--warning-light);
    color: var(--warning);
}

.woocommerce-order-status.status-pending {
    background: var(--danger-light);
    color: var(--danger);
}

.woocommerce-order-status.status-on-hold {
    background: var(--accent-light);
    color: var(--accent);
}

/* WooCommerce Forms */
.woocommerce-form-row {
    margin-bottom: 1.25rem;
}

.woocommerce-form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.woocommerce-Input,
.woocommerce-form-row input[type="text"],
.woocommerce-form-row input[type="email"],
.woocommerce-form-row input[type="password"],
.woocommerce-form-row select,
.woocommerce-form-row textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: var(--transition);
    font-family: inherit;
}

.woocommerce-Input:focus,
.woocommerce-form-row input:focus,
.woocommerce-form-row select:focus,
.woocommerce-form-row textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--shadow-focus);
}

/* WooCommerce Buttons */
.woocommerce-button,
.woocommerce-form-row button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-size: var(--font-size-sm);
}

.woocommerce-button:hover,
.woocommerce-form-row button:hover,
.button:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: white;
}

.woocommerce-button.button--secondary {
    background: white;
    color: var(--brand);
    border: 1px solid var(--brand);
}

.woocommerce-button.button--secondary:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
}

/* Address Cards */
.woocommerce-address {
    background: white;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    position: relative;
    transition: var(--transition);
}

.woocommerce-address:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-primary);
}

.woocommerce-address .title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

/* Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 1rem 3rem;
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    position: relative;
    border-left: 4px solid;
}

.woocommerce-message {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.woocommerce-info {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

.woocommerce-error {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* Payment Methods */
.woocommerce-PaymentMethods {
    margin-top: 2rem;
}

.woocommerce-PaymentMethod {
    background: white;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.woocommerce-PaymentMethod:hover {
    border-color: var(--border-primary);
    box-shadow: var(--shadow-sm);
}

/* Order Details */
.woocommerce-order-details {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-secondary);
}

.woocommerce-order-details__title {
    color: var(--text-primary);
    border-bottom: 2px solid var(--brand);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ========================================
   12. PRESCRIPTION FORMS
======================================== */
#tph-form.card {
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    position: relative;
    margin: 0 auto;
}

#tph-form.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.8;
}

#tph-form .h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#tph-form .h1 + div {
    color: var(--text-muted);
    font-size: var(--font-size-base);
    margin-bottom: 2rem;
    text-align: right;
    line-height: 1.6;
}

#tph-step[data-step="1"] {
    display: grid;
    gap: 1.25rem;
}

#tph-step .h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
    text-align: right;
}

/* Form field containers */
#tph-step > div {
    background: rgba(248, 249, 250, 0.3);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

#tph-step > div:hover {
    background: rgba(110, 139, 255, 0.02);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Prescription input fields */
input[id^="p_"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    text-align: right;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

input[id^="p_"]:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--shadow-focus);
    transform: translateY(-1px);
}

/* Continue button styling */
#tph-step .btn[onclick*="המשך"] {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    margin-top: 1.5rem;
    width: auto;
    justify-self: center;
    min-width: 150px;
}

#tph-step .btn[onclick*="המשך"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--accent), var(--brand-dark));
}

/* ========================================
   13. PRODUCT GRID & TABS
======================================== */
.tph-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 0 0 1.5rem;
}

.tph-step {
    background: white;
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tph-step-badge{
    position:absolute;
    top:-6px;
    left:-6px;
    min-width:18px;
    height:18px;
    padding:0 5px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
    font-weight:700;
    background:#e53935;
    color:#fff;
    line-height:1;
}

.tph-step::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    border-radius: var(--radius-md);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.tph-step.is-active,
.tph-step:hover {
    border-color: var(--accent-light);
    box-shadow: var(--shadow-md);
    opacity: 1;
    transform: translateY(-2px);
}

.tph-step.is-active::before,
.tph-step:hover::before {
    opacity: 0.1;
}

.tph-step svg path {
    fill: var(--text-muted);
    transition: var(--transition);
}

.tph-step.is-active svg path,
.tph-step:hover svg path {
    fill: var(--accent-light);
}

.tph-tabs {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 0 0 1.5rem;
    flex-wrap: wrap;
}

.tph-tab {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 600;
    border: 2px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--font-size-sm);
}

.tph-tab:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.tph-tab--active {
    background: var(--accent-light);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tph-preps {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}


.tph-prep {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

.tph-prep:hover {
    color: var(--accent-light);
    transform: translateY(-2px);
}

.tph-prep--active {
    color: var(--accent-light);
}

.tph-prep__icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(34, 194, 173, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.tph-prep:hover .tph-prep__icon,
.tph-prep--active .tph-prep__icon {
    background: rgba(34, 194, 173, 0.2);
    transform: scale(1.1);
}

#tph-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.tph-preps-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.tph-var {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.tph-variation-block {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.tph-var:hover {
    border-color: var(--border-hover);
    background: var(--bg-accent);
}

.tph-empty {
    text-align: center;
    color: var(--text-light);
    padding: 3rem 0;
    font-size: var(--font-size-lg);
}

/* ========================================
   14. UTILITIES & ANIMATIONS
======================================== */
#tph-loader {
    position: fixed;
    top: 0;
    z-index: var(--z-modal);
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.svg-loader{
    display:flex;
    position: relative;
    align-content: space-around;
    justify-content: center;
}
.loader-svg{
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    fill: none;
    stroke-width: 5px;
    stroke-linecap: round;
    stroke: var(--accent-light);
}
.loader-svg.bg{
    stroke-width: 8px;
    stroke: #fff;
}

.animate{
    stroke-dasharray: 242.6;
    animation: fill-animation 1s cubic-bezier(1,1,1,1) 0s infinite;
}

@keyframes fill-animation{
    0%{
        stroke-dasharray: 40 242.6;
        stroke-dashoffset: 0;
    }
    50%{
        stroke-dasharray: 141.3;
        stroke-dashoffset: 141.3;
    }
    100%{
        stroke-dasharray: 40 242.6;
        stroke-dashoffset: 282.6;
    }
}

#formula_save.is-loading,
#submitrx.is-loading{
    position: relative;
    opacity: .75;
}

#formula_save.is-loading::after,
#submitrx.is-loading::after{
    content: "";
    position: absolute;
    inset-inline-end: 12px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: tph-spin .6s linear infinite;
}

@keyframes tph-spin {
    to { transform: rotate(360deg); }
}


/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Staggered animations for form fields */
#tph-step[data-step="1"] > div {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

#tph-step[data-step="1"] > div:nth-child(1) { animation-delay: 0.1s; }
#tph-step[data-step="1"] > div:nth-child(2) { animation-delay: 0.2s; }
#tph-step[data-step="1"] > div:nth-child(3) { animation-delay: 0.3s; }
#tph-step[data-step="1"] > div:nth-child(4) { animation-delay: 0.4s; }

/* Utility classes */
.hidden { display: none !important; }
.invisible { opacity: 0; }
.visible { opacity: 1; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }
.select-text { user-select: text; }

/* Margin and padding utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }
.m-8 { margin: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.ml-auto { margin-left: auto; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mr-auto { margin-right: auto; }

.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pt-8 { padding-top: 2rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-8 { padding-bottom: 2rem; }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: 0.25rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-3 { padding-left: 0.75rem; }
.pl-4 { padding-left: 1rem; }
.pl-6 { padding-left: 1.5rem; }

.pr-0 { padding-right: 0; }
.pr-1 { padding-right: 0.25rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-3 { padding-right: 0.75rem; }
.pr-4 { padding-right: 1rem; }
.pr-6 { padding-right: 1.5rem; }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

/* Width and height utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-2\/3 { width: 66.666667%; }
.w-1\/4 { width: 25%; }
.w-3\/4 { width: 75%; }

.h-full { height: 100%; }
.h-auto { height: auto; }
.h-screen { height: 100vh; }
.h-fit { height: fit-content; }

.min-h-0 { min-height: 0; }
.min-h-full { min-height: 100%; }
.min-h-screen { min-height: 100vh; }

.max-w-none { max-width: none; }
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-full { max-width: 100%; }

/* RTL Support */
.rtl {
    direction: rtl;
}

.rtl .nav__menu {
    width: 100%;
    justify-content: space-between;
}

.rtl .woocommerce-MyAccount-navigation ul li a {
    text-align: right;
}

.rtl .woocommerce-MyAccount-navigation ul li a::before {
    left: auto;
    right: 0;
    border-radius: 2px 0 0 2px;
}

.rtl .woocommerce-MyAccount-navigation ul li a:hover,
.rtl .woocommerce-MyAccount-navigation ul li.is-active a {
    transform: translateX(-4px);
}


.rtl .link-underline::after {
    left: auto;
    right: 0;
}



/* ========================================
   15. MEDIA QUERIES
======================================== */

/* Extra large devices */
@media (min-width: 1400px) {
    :root {
        --container-max-width: 1500px;
    }
    .container {
        padding: 3rem 2rem;
    }

    .nav {
        padding: 1.25rem 3rem;
    }

    .tph-login-hero {
        max-width: 1300px;
        gap: 4rem;
    }
}

/* Large devices */
@media (max-width: 1199px) {
    :root {
        --container-max-width: 1140px;
        --sidebar-width: 260px;
    }

    .woocommerce-MyAccount-navigation {
        flex: 0 0 260px;
    }

    .grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }

    #tph-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

/* Medium devices */
@media (max-width: 991px) {
    :root {
        --container-max-width: 767px;
        --navbar-height: 80px;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    .nav {
        padding: 1rem 1.5rem;
        min-height: 80px;
    }

    .h1 {
        font-size:clamp(var(--font-size-2xl), 2vw, var(--font-size-4xl));
    }

    .nav__menu {
        gap: 1rem;
    }

    .nav__menu a {
        padding: 0.5rem 0.75rem;
        font-size: var(--font-size-xs);
    }

    .woocommerce-account .woocommerce {
        flex-direction: column;
        gap: 1.5rem;
    }

    .woocommerce-MyAccount-navigation {
        flex: none;
        position: static;
        width: 100%;
    }

    .woocommerce-MyAccount-navigation ul {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .woocommerce-MyAccount-content {
        padding: 1.5rem;
    }

    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tph-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .tph-login-hero {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 1.5rem;
        max-width: 600px;
    }

    .tph-login-hero .tph-column {
        max-width: 100%;
    }

    .table th,
    .table td {
        padding: 0.5rem;
        font-size: var(--font-size-xs);
    }

    .card {
        padding: 1.25rem;
    }

    #tph-form.card {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .badge {
        padding: 0.375rem 0.75rem;
        font-size: var(--font-size-xs);
    }
}

/* Small devices */
@media (max-width: 767px) {
    :root {
        --container-max-width: 540px;
        --navbar-height: 70px;
        --font-size-xs: 11px;
        --font-size-sm: 13px;
        --font-size-base: 15px;
        --font-size-lg: 17px;
    }

    body .container .grid {
        display:flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap:0.25rem;
    }

    .container {
        padding: 1rem 0.75rem;
    }

    .nav {
        padding: 0.75rem 1rem;
        min-height: 70px;
        flex-wrap: wrap;
    }

    .nav__brand {
        font-size: var(--font-size-lg);
    }

    ul#menu-primary {
        flex-direction: column;
        padding:0;
    }

    .nav__toggle { position: relative; width: 40px; height: 40px; background: none;outline: none;display: flex;justify-content: center;align-items: center; }
    .nav__toggle .bar {
        width: 22px; height: 2px; background: var(--text-primary);
        border-radius: 2px; transition: var(--transition); position: absolute;
    }
    .nav__toggle .bar:nth-child(1) { transform: translateY(-7px); }
    .nav__toggle .bar:nth-child(2) { transform: translateY(0);   }
    .nav__toggle .bar:nth-child(3) { transform: translateY(7px); }

    .nav__toggle[aria-expanded="true"] .bar:nth-child(1) { transform: rotate(45deg); }
    .nav__toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
    .nav__toggle[aria-expanded="true"] .bar:nth-child(3) { transform: rotate(-45deg); }

    .nav__menu {
        display: flex !important;            /* override previous display:none */
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.75rem;

        max-height: 0;                       /* collapsed */
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        visibility: hidden;
        overflow: hidden;
        transition: max-height .35s ease, opacity .25s ease, transform .25s ease, visibility .25s;
    }
    .nav__menu.is-open {
        max-height: 70vh;                     /* enough for menu items */
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }




    .tph-filters {
        flex-direction: column;
    }

    .nav__menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        margin-top: 0.75rem;
        display: none;
    }

    .nav__menu.is-open {
        display: flex;
        align-items: start;
    }


    .grid--2,
    .grid--3,
    .grid--4,
    .grid--auto {
        grid-template-columns: 1fr;
    }

    .tph-grid-2 {
        grid-template-columns: 1fr;
    }

    .tph-steps {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .tph-step {
        padding: 0.75rem;
    }

    .tph-step svg {
        width:30px;
        height:30px;
    }

    .tph-tabs {
        grid-template-columns: repeat(2, 1fr);
        display:grid;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .tph-card__media {
        aspect-ratio: unset;
    }

    .tph-card__svg svg {
        width:1rem;
        height:1rem;
    }

    .tph-card-box {
        width:unset;
        height: unset;
        padding:0.5rem;
    }


    .tph-tab {
        padding: 0.5rem 0.75rem;
        font-size: var(--font-size-xs);
    }

    .tph-tab svg {
        width:40px;
        height:40px;
    }

    .tph-preps {
        gap: 1rem;
        margin: 0.75rem 0 1rem;
    }

    .tph-prep__icon {
        width: 50px;
        height: 50px;
    }


    .tph-preps-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
        display:grid;
    }

    #tph-step[data-step="1"],
    div[data-s="4"] > .summary{
display:flex !important;
    flex-direction: column;
    }

    .formula_bottom {
        flex-direction: column;
        gap: 1rem;
    }


    .tph-card__body {
        padding: 0.5rem;
        gap: 0.375rem;
    }

    .tph-card__title {
        font-size: var(--font-size-xs);
    }

    .tph-card__price {
        font-size: var(--font-size-sm);
    }

    .tph-login-hero {
        padding: 1.5rem 1rem;
        gap: 1.5rem;
        margin: 0 0.5rem;
    }

    .tph-login-form {
        gap: 1.25rem;
    }

    .tph-login-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: var(--font-size-xs);
    }

    .btn--lg {
        padding: 0.875rem 1.5rem;
        font-size: var(--font-size-base);
    }

    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .woocommerce-MyAccount-navigation ul {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .woocommerce-MyAccount-content {
        padding: 1rem;
    }

    .table-responsive {
        font-size: var(--font-size-sm);
    }

    .table th,
    .table td {
        padding: 0.25rem;
    }

    .woocommerce-orders-table__cell {
        padding: 0.75rem;
        font-size: var(--font-size-xs);
    }

    #tph-form.card {
        padding: 1rem;
        margin: 0 0.5rem;
    }

    #tph-form .h1 {
        font-size: var(--font-size-2xl);
    }

    #tph-step > div {
        padding: 1rem;
    }

    input[id^="p_"] {
        padding: 0.875rem 1rem;
        font-size: var(--font-size-sm);
    }
}

/* Extra small devices */
@media (max-width: 575px) {
    :root {
        --container-max-width: 100%;
        --navbar-height: 60px;
        --font-size-xs: 10px;
        --font-size-sm: 12px;
        --font-size-base: 14px;
    }

    .container {
        padding: 0.75rem 0.5rem;
    }

    .nav {
        padding: 0.5rem 0.75rem;
        min-height: 60px;
    }

    .nav__brand {
        font-size: var(--font-size-base);
    }

    .tph-login-hero {
        padding: 1rem 0.75rem;
        border-radius: var(--radius-lg);
        margin: 0 0.25rem;
    }

    .tph-login-form {
        gap: 1rem;
    }

    .card {
        padding: 0.75rem;
        border-radius: var(--radius-lg);
    }


    .btn {
        padding: 0.5rem 0.875rem;
    }

    .badge {
        padding: 0.25rem 0.5rem;
    }

    .woocommerce-MyAccount-navigation {
        padding: 1rem;
    }

    .woocommerce-MyAccount-content {
        padding: 0.75rem;
    }

    #tph-form.card {
        padding: 0.75rem;
        margin: 0 0.25rem;
    }

    .tph-prep__icon {
        width: 40px;
        height: 40px;
    }

    .tph-var {
        padding: 0.5rem;
        gap: 0.5rem;
    }
}

/* Print styles */
@media print {
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        background: white !important;
        font-size: 12pt;
        line-height: 1.4;
    }

    .nav,
    .nav__toggle,
    .btn,
    .badge,
    #tph-loader {
        display: none !important;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    .card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    .table {
        border-collapse: collapse;
    }

    .table th,
    .table td {
        border: 1px solid #ddd;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
    }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    #tph-step[data-step="1"] > div {
        animation: none;
        opacity: 1;
    }
}

/* High contrast mode */
@media (prefers-contrast: more) {
    :root {
        --border-secondary: rgba(0, 0, 0, 0.3);
        --border-light: rgba(0, 0, 0, 0.2);
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }

    .card,
    .tph-card,
    .btn,
    .badge {
        border-width: 2px;
    }

    .btn:focus,
    .tph-input:focus,
    .tph-textarea:focus,
    .tph-select:focus {
        outline: 3px solid;
        outline-offset: 2px;
    }
}


/* POPUP - Updated Design */
#tpl-mini-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#tpl-mini-modal:not([hidden]),
#tpl-mini-modal.is-open {
    display: flex;
    opacity: 1;
}

#tpl-mini-modal[hidden] {
    display: none !important;
}

.tpl-mini-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 0;
}

.tpl-mini-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-lg);
    max-width: min(720px, 95vw);
    width: 100%;
    max-height: 90vh;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    overflow: hidden;
}

#tpl-mini-modal:not([hidden]) .tpl-mini-dialog {
    transform: scale(1);
}

/* Header */
.tpl-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
}

.tpl-mini-head .h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tpl-mini-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    line-height: 1;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpl-mini-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Body */
.tpl-mini-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

/* Name input */
.tpl-mini-body .row {
    margin-bottom: 1.5rem;
}

.tpl-mini-body .row label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#tpl-mini-name {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: white;
    transition: var(--transition);
}

#tpl-mini-name:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* Table wrapper */
.tpl-mini-body .row:has(.tpl-mini-table) {
    margin-bottom: 0;
}

.tpl-mini-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: white;
    margin: 0;
}

.tpl-mini-table th,
.tpl-mini-table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--border-light);
}

.tpl-mini-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.tpl-mini-table tbody tr:hover {
    background: var(--bg-accent);
}

.tpl-mini-table tbody tr:last-child td {
    border-bottom: none;
}

/* Form fields in table */
.tpl-mini-field {
    position: relative;
    width: 100%;
}

.tpl-mini-herb,
.tpl-mini-percent {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    background: white;
    transition: var(--transition);
}

.tpl-mini-herb:focus,
.tpl-mini-percent:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(30, 152, 165, 0.1);
}

.tpl-mini-percent {
    text-align: center;
}

/* Autocomplete */
.tpl-mini-ac {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-secondary);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    margin: 0;
    padding: 0;
    list-style: none;
}

.tpl-mini-ac li {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.tpl-mini-ac li:hover {
    background: var(--bg-accent);
}

.tpl-mini-ac li:last-child {
    border-bottom: none;
}

/* Remove button */
.tpl-mini-table .rm {
    background: var(--danger);
    color: white;
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: var(--font-size-base);
    line-height: 1;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpl-mini-table .rm:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

/* Table footer */
.tpl-mini-table tfoot {
    border-top: 2px solid var(--border-secondary);
    background: var(--bg-secondary);
}

.tpl-mini-table tfoot td {
    padding: 1rem 0.75rem;
    border-bottom: none;
}

/* Add button */
#tpl-mini-add {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition);
}

#tpl-mini-add:hover {
    background: #15803d;
    transform: translateY(-1px);
}

/* Total display */
.tpl-mini-table tfoot span {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.tpl-mini-table tfoot span b {
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

/* Messages */
#tpl-mini-msg {
    min-height: 1.25rem;
    font-size: var(--font-size-sm);
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

#tpl-mini-msg:not(:empty) {
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
}

/* Footer */
.tpl-mini-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
}

.tpl-mini-save,
.tpl-mini-cancel {
    padding: 0.75rem 1.5rem;
    border: 1px solid;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition);
    min-width: 80px;
}

.tpl-mini-save:disabled,
.tpl-mini-cancel:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tpl-mini-save {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.tpl-mini-save:hover:not(:disabled) {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-1px);
}

.tpl-mini-cancel {
    background: white;
    color: var(--text-secondary);
    border-color: var(--border-secondary);
}

.tpl-mini-cancel:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Responsive */
@media (max-width: 640px) {
    .tpl-mini-dialog {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .tpl-mini-head,
    .tpl-mini-body,
    .tpl-mini-foot {
        padding: 1rem;
    }

    .tpl-mini-table th,
    .tpl-mini-table td {
        padding: 0.5rem;
    }

    .tpl-mini-save,
    .tpl-mini-cancel {
        padding: 0.625rem 1rem;
        font-size: var(--font-size-xs);
    }
}

/* overlays inside modal */
.tpl-mini-dialog { position: relative; }

.tpl-mini-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    backdrop-filter: blur(1px);
}

.tpl-mini-overlay.is-visible { display: flex; }

/* loader */
.tpl-mini-loader {
    background: rgba(255,255,255,.75);
}
.tpl-mini-spinner {
    width: 54px; height: 54px;
    border-radius: 50%;
    border: 6px solid #e7e7e7;
    border-top-color: #0aa869;
    animation: tplspin 1s linear infinite;
}
@keyframes tplspin { to { transform: rotate(360deg); } }

/* success check */
.tpl-mini-success {
    background: rgba(20,160,90,.92);
    color: #fff;
    text-align: center;
}
.tpl-mini-success .tpl-mini-check {
    font-size: 84px;
    line-height: 1;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,.25);
}
