/* ============================================================
   Aromatic Hug — Global Stylesheet
   Pure CSS (no @apply — not compatible with Tailwind CDN)
   ============================================================ */

/* ---- Fonts ---- */
html {
    overflow-x: hidden;
}
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.font-serif, h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: #D18E50; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #5A3C17; }

/* ---- Scroll Reveal Animations ---- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay helpers */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }

/* ---- Hero keyframe animations ---- */
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-28px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in    { animation: fade-in    0.9s ease-in-out both; }
.animate-slide-down { animation: slide-down 0.9s ease-out both; }
.animate-slide-up   { animation: slide-up   0.9s ease-out both; }

/* ---- Toast Notification ---- */
#toast-container {
    position: fixed;
    top: 120px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    pointer-events: auto;
    animation: toast-in 0.35s ease both;
    max-width: 320px;
}

.toast.success { background: #2d6a4f; }
.toast.error   { background: #c0392b; }
.toast.info    { background: #5A3C17; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}

.toast.removing { animation: toast-out 0.3s ease both; }

/* ---- Product Cards ---- */
.product-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: #fff;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.product-card:hover {
    box-shadow: 0 16px 48px rgba(90, 60, 23, 0.18);
    transform: translateY(-4px);
}

.product-card img {
    transition: transform 0.6s ease;
}

.product-card:hover img {
    transform: scale(1.08);
}

/* ---- Line Clamp Utilities ---- */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Customisation Option Cards ---- */
.option-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
    transition: border-color 0.25s, background 0.25s, transform 0.2s;
    user-select: none;
    font-size: 13px;
    font-weight: 500;
    color: #5A3C17;
    background: #fdf6ef;
}

.option-card:hover {
    border-color: #E8742A;
    background: #fff4eb;
    transform: scale(1.03);
}

.option-card.selected {
    border-color: #E8742A;
    background: #fff4eb;
    color: #E8742A;
}

/* Color swatch option */
.color-swatch-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    transition: border-color 0.25s, transform 0.2s;
}

.color-swatch-card:hover,
.color-swatch-card.selected {
    border-color: #E8742A;
    transform: scale(1.05);
}

/* ---- Admin Table ---- */
.admin-table th {
    background: #5A3C17;
    color: #FFE0CC;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    padding: 17px 22px;
    text-align: left;
    white-space: nowrap;
    border-bottom: none;
}

.admin-table td {
    padding: 14px 22px;
    border-bottom: 1px solid #f3e8dc;
    vertical-align: middle;
    font-size: 13.5px;
    color: #444;
    background: #fff;
    transition: background 0.12s;
}

.admin-table tr:last-child td { border-bottom: none; }

/* ============================================================
   DataTables — Aromatic Hug Brand Theme
   Structure: dt-top-bar | dt-table-wrap | dt-bottom-bar
   ============================================================ */

/* ── Top control bar ─────────────────────────────────────── */
.dt-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 40px;
    background: #fffaf7;
    border-bottom: 1px solid #f3e8dc;
    border-radius: 12px 12px 0 0;
}

/* ── Scrollable table wrap ───────────────────────────────── */
.dt-table-wrap {
    overflow-x: auto;
    padding: 0 20px;
}

/* ── Bottom info / pagination bar ───────────────────────── */
.dt-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 40px;
    background: #fffaf7;
    border-top: 1px solid #f3e8dc;
    border-radius: 0 0 12px 12px;
}

/* ── Length ("Show X entries") ───────────────────────────── */
div.dataTables_length {
    font-size: 12.5px;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
}

div.dataTables_length label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin: 0;
}

div.dataTables_length select {
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    padding: 5px 28px 5px 10px;
    font-size: 12.5px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #5A3C17;
    background: #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%235A3C17' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E")
        no-repeat right 6px center / 13px;
    appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

div.dataTables_length select:focus {
    border-color: #E8742A;
    box-shadow: 0 0 0 3px rgba(232, 116, 42, 0.15);
}

/* ── Search / Filter input ───────────────────────────────── */
div.dataTables_filter {
    font-size: 12.5px;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
}

div.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin: 0;
}

div.dataTables_filter input[type="search"] {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 7px 14px 7px 36px;
    font-size: 12.5px;
    font-family: 'Inter', sans-serif;
    outline: none;
    width: 230px;
    background-color: #f9fafb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' stroke='%23b0aaa4' stroke-width='1.6'/%3E%3Cpath stroke='%23b0aaa4' stroke-width='1.6' stroke-linecap='round' d='M15.5 15.5L19 19'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 11px center;
    background-size: 15px;
    color: #374151;
    transition: border-color 0.2s, box-shadow 0.2s, width 0.25s;
}

div.dataTables_filter input[type="search"]:focus {
    border-color: #E8742A;
    box-shadow: 0 0 0 3px rgba(232, 116, 42, 0.15);
    background-color: #fff;
    width: 270px;
}

div.dataTables_filter input[type="search"]::placeholder {
    color: #bab5b0;
}

/* ── Info text ───────────────────────────────────────────── */
div.dataTables_info {
    font-size: 12px;
    color: #b5a99f;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* ── Pagination ──────────────────────────────────────────── */
div.dataTables_paginate {
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: 'Inter', sans-serif;
}

div.dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e9e0d8;
    background: #fff;
    color: #6b6560;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
    box-sizing: border-box;
}

div.dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #FFE0CC;
    border-color: #E8742A;
    color: #5A3C17;
}

div.dataTables_paginate .paginate_button.current,
div.dataTables_paginate .paginate_button.current:hover {
    background: #E8742A;
    border-color: #E8742A;
    color: #fff;
    box-shadow: 0 2px 8px rgba(232, 116, 42, 0.35);
}

div.dataTables_paginate .paginate_button.disabled,
div.dataTables_paginate .paginate_button.disabled:hover {
    color: #d6cec8;
    cursor: default;
    background: #faf7f5;
    border-color: #f0ece8;
    box-shadow: none;
}

/* ── Sort icons ──────────────────────────────────────────── */
table.dataTable thead th.sorting  { cursor: pointer; }
table.dataTable thead th.sorting::after {
    content: '\2195';
    font-size: 9px;
    color: rgba(255, 224, 204, 0.4);
    margin-left: 5px;
    display: inline-block;
}
table.dataTable thead th.sorting_asc::after  { content: '\2191'; color: #FFE0CC; }
table.dataTable thead th.sorting_desc::after { content: '\2193'; color: #FFE0CC; }
table.dataTable thead th.sorting_disabled::after { content: ''; }

/* ── Table resets (neutralize jquery.dataTables.min.css) ── */
table.dataTable             { border-collapse: collapse !important; margin: 0 !important; width: 100% !important; }
table.dataTable.no-footer   { border-bottom: none !important; }
table.dataTable thead th,
table.dataTable thead td    { border-bottom: none !important; padding: 0 !important; }
table.dataTable tbody td    { border-top: none !important; }
table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd { background: transparent; }

/* ── Empty state ─────────────────────────────────────────── */
td.dataTables_empty {
    text-align: center !important;
    padding: 60px 20px !important;
    color: #b5a99f !important;
    font-size: 14px !important;
}

/* ── Row hover left-accent stripe ───────────────────────── */
.admin-table tbody tr { transition: background 0.12s; }
.admin-table tbody tr:hover td { background: #fdf6ef; }
.admin-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 #E8742A; }

/* ── Expanded child row (categories) ────────────────────── */
table.dataTable tbody tr.dt-hasChild > td,
table.dataTable tbody tr.shown > td {
    background: #fff8f3 !important;
    border-bottom: none !important;
}
table.dataTable tbody tr.dt-hasChild > td:first-child { box-shadow: inset 3px 0 0 #E8742A !important; }

tr.child td,
tr.child td.child {
    padding: 0 !important;
    background: transparent !important;
    border-top: none !important;
    border-bottom: 1px solid #f0e8e0 !important;
}

/* ── Categories Child-Row (layout via inline styles in JS) ─ */

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fade-in 0.2s ease both;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    animation: slide-up 0.3s ease both;
}

/* ---- Aspect ratio helper ---- */
.aspect-4\/5 { aspect-ratio: 4 / 5; }
.aspect-square { aspect-ratio: 1 / 1; }

/* ---- Input focus ring ---- */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 116, 42, 0.25);
    border-color: #E8742A !important;
}

/* ---- Responsive utilities ---- */
@media (max-width: 768px) {
    .hide-mobile { display: none; }
}

/* ---- Navbar scroll colour transition ---- */
#main-nav {
    background: #FFE0CC;
    border-bottom: 1px solid rgba(90,60,23,0.08);
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

#main-nav.nav-scrolled {
    background: #ffffff;
    border-bottom-color: #f3f4f6;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
