/* NNPLM Theme Custom Styles - Nicole Nussbaum Brand */
:root {
    /* Brand colors from existing Nussbaum design system */
    --primary-color: #006647;
    --primary-hover: #256153;
    --secondary-color: #8F444C;
    --accent-color: #600062;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-body: #eceaec;
    --bg-white: #FFFFFF;
    --bg-modal: #FBFBFB;
    --bg-badge: #ead9fc;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Brand specific radius */
    --border-radius: 5px;
}

/* Body and base styles - aligned with Nussbaum brand */
* {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    margin-top: 2rem;
    background-color: var(--bg-body);
}

/* Ensure Sarabun is used for all typography elements */
h1, h2, h3, h4, h5, h6,
p, span, div, a, button,
.card-title, .card-text, .card-body,
.btn, .form-control, .table,
.navbar-nav, .nav-link,
.breadcrumb, .badge {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Brand background pattern */
.body-bg {
    background: url(https://nicolenussbaum.ch/typo3conf/ext/bootstrap_package/Resources/Public/nussbaum/background.svg) no-repeat bottom left;
    background-size: 100%;
}

/* Container styling */
.container .m1 {
    padding-right: 0px;
    padding-left: 0px;
}

/* Header styles - Brand aligned */
.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar {
    border-radius: var(--border-radius);
    margin-top: 10px;
    background-color: transparent !important;
    border-bottom: none;
    box-shadow: none;
}

.bg-dark {
    background-color: transparent !important;
}

/* Logo styling */
.logo-main-image img {
    padding-top: 0px;
    padding-bottom: 0px;
    position: relative;
    top: 50%;
    width: auto;
    max-height: calc(85% - 53px);
}

@media (min-width: 992px) {
    .logo-main-image img {
        max-height: 85%;
        margin: auto;
        display: block;
    }
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Product cards - Brand consistent */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    overflow: visible; /* Changed from hidden to visible for dropdown */
    background-color: var(--bg-white);
    position: relative; /* Ensure proper positioning context */
}

.card h3.card-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.card h3.card-title a:hover {
    color: var(--primary-hover);
}

/* Fix for dropdown overflow in product cards */
.card-footer {
    overflow: visible; /* Ensure dropdowns can extend beyond card */
    position: relative;
    z-index: 10; /* Ensure dropdown appears above other cards */
}

.card-footer .dropdown {
    position: static; /* Allow dropdown to break out of card boundaries */
}

/* Specific styling for dropdown menus in cards */
.card .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    z-index: 1000;
    min-width: 200px;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
}

/* Ensure dropdown is visible above other cards */
.produkt-card:hover {
    z-index: 20;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

/* Badges and labels */
.badge-primary {
    background-color: var(--primary-color);
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
}

/* Buttons - Brand aligned */
.btn-primary, 
.btn.btn-primary.active.snipcart-add-item,
.btn.btn-primary.green {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.6em 2em;
    border-radius: 3px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover,
.btn.btn-primary.active.snipcart-add-item:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(44, 95, 65, 0.05);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 95, 65, 0.25);
}

/* Breadcrumbs */
.breadcrumb {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* PLM specific styles */
.produkt-detail,
.charge-detail,
.produktuebersicht {
    padding: 2rem 0;
}

.info-card {
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-white) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Quality control indicators */
.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

/* Charge tracking styles */
.table-warning td {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.charge-header h1 {
    color: var(--primary-color);
    font-weight: 700;
}

/* QR code placeholder */
.qr-placeholder {
    background: linear-gradient(45deg, var(--bg-body), #e9ecef);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
}

/* Dropdown menus */
ul.dropdown-menu,
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 1050;
}

/* Product grid specific dropdown fixes */
.produkte-grid {
    /* Ensure grid items don't clip dropdowns */
    overflow: visible;
}

.produkt-card {
    /* Ensure individual cards can show dropdowns */
    overflow: visible;
    position: relative;
}

.produkt-card .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    transform: none;
    z-index: 1050;
    min-width: 220px;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Ensure dropdown is properly positioned and visible */
.produkt-card .card-footer {
    position: relative;
    z-index: 10;
    overflow: visible;
}

.produkt-card .card-footer .dropdown {
    position: relative;
}

/* Hover state for better dropdown visibility */
.produkt-card:hover {
    z-index: 100;
}

/* Images - consistent border radius */
img {
    border-radius: var(--border-radius);
}

/* Footer styling */
.footer-copyright p {
    font-size: 3em;
    color: var(--secondary-color);
    font-family: "Sarabun", sans-serif;
}

.footer-meta .meta-menu a {
    text-decoration: none;
    font-weight: 700;
}

.footer-meta .meta-menu a:not(.btn):hover {
    text-decoration: underline;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
    }
    
    .info-card {
        margin-bottom: 1rem;
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.4rem 1rem;
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}