/**
 * Base Styles
 *
 * Typography, resets, and common utilities.
 * Uses CSS variables from colors-variables.css for theming.
 */

/* ========================================
   Reset & Box Sizing
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: var(--font-family, "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif), sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-color, #333333);
    background-color: var(--background-color, #f4f6f7);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-family: var(--font-family, "Poppins", sans-serif), sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-title-color, #333333);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin: 0 0 1em;
}

a {
    color: var(--primary-color, #213a86);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-comliment-color, #0073ff);
    text-decoration: underline;
}

strong, b {
    font-weight: 600;
}

small {
    font-size: 0.875em;
}

/* ========================================
   Lists
   ======================================== */

ul, ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

li {
    margin-bottom: 0.25em;
}

/* ========================================
   Images & Media
   ======================================== */

img, svg, video {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* ========================================
   Forms
   ======================================== */

button, input, select, textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.5;
    margin: 0;
}

button {
    cursor: pointer;
}

input:not([type="range"]):not([type="color"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    padding: 10px 14px;
    border: 1px solid var(--border-color-light, #b2b2b2);
    border-radius: 6px;
    background-color: #ffffff;
    color: var(--text-color, #333333);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color, #213a86);
    box-shadow: 0 0 0 3px rgba(33, 58, 134, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--input-color, #a4a4a4);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color, #333333);
}

/* ========================================
   Custom Checkboxes - Larger, Secondary Color
   ======================================== */

/* Hide default checkbox */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--secondary-color, #6c757d);
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    vertical-align: middle;
}

input[type="checkbox"]:hover {
    border-color: var(--secondary-hover-color, #545b62);
}

input[type="checkbox"]:checked {
    background: var(--secondary-color, #6c757d);
    border-color: var(--secondary-color, #6c757d);
}

input[type="checkbox"]:checked::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.25);
}

/* Checkbox with label - inline layout */
.checkbox-label,
label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

/* ========================================
   Tables
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color-light, #e5e5e5);
}

th {
    font-weight: 600;
    background-color: var(--background-shaded-color, #f5f5f5);
}

/* ========================================
   Layout Utilities
   ======================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container--sm {
    max-width: 800px;
}

.container--lg {
    max-width: 1400px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* ========================================
   Grid System
   ======================================== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 15px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 15px; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 15px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 15px; }

@media (min-width: 768px) {
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 992px) {
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
}

/* Custom column helpers */
.col-half { flex: 0 0 50%; max-width: 50%; padding: 0 15px; }
.col-quarter { flex: 0 0 25%; max-width: 25%; padding: 0 15px; }
.col-auto { flex: 0 0 auto; width: auto; }

@media (max-width: 767px) {
    .col-half,
    .col-quarter {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ========================================
   Spacing Utilities
   ======================================== */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }
.pt-5 { padding-top: 3rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }
.pb-5 { padding-bottom: 3rem; }

.pr-0 { padding-right: 0; }
.pr-1 { padding-right: 0.5rem; }
.pr-2 { padding-right: 1rem; }
.pr-3 { padding-right: 1.5rem; }
.pr-4 { padding-right: 2rem; }
.pr-5 { padding-right: 3rem; }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: 0.5rem; }
.pl-2 { padding-left: 1rem; }
.pl-3 { padding-left: 1.5rem; }
.pl-4 { padding-left: 2rem; }
.pl-5 { padding-left: 3rem; }

/* Horizontal centering */
.mx-auto { margin-left: auto; margin-right: auto; }

/* Page section spacing (accounts for fixed nav) */
.pt-100 { padding-top: 100px; }
.pb-100 { padding-bottom: 100px; }

/* Media object pattern */
.media-body { flex: 1; }

/* ========================================
   Display Utilities
   ======================================== */

.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Width/Height Utilities */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.h-100 { height: 100%; }
.h-auto { height: auto; }

/* Border Utilities */
.border { border: 1px solid var(--border-color-light, #b2b2b2); }
.border-0 { border: 0; }
.border-top { border-top: 1px solid var(--border-color-light, #b2b2b2); }
.border-bottom { border-bottom: 1px solid var(--border-color-light, #b2b2b2); }
.rounded { border-radius: 8px; }
.rounded-0 { border-radius: 0; }
.rounded-circle { border-radius: 50%; }

/* ========================================
   Text Utilities
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: var(--text-title-color, #6c6c6c); }
.text-primary { color: var(--primary-color, #213a86); }
.text-success { color: #22c55e; }
.text-danger { color: #ef4444; }

/* Ensure semantic colors override element-specific colors */
.info-value.text-success { color: #22c55e; }
.info-value.text-danger { color: #ef4444; }
.text-warning { color: var(--warning-button-color, #ffb400); }

.font-weight-normal { font-weight: 400; }
.font-weight-medium { font-weight: 500; }
.font-weight-bold { font-weight: 600; }

/* ========================================
   Visibility
   ======================================== */

@media (max-width: 767px) {
    .d-md-none { display: none; }
}

@media (min-width: 768px) {
    .d-md-block { display: block; }
    .d-md-inline { display: inline; }
    .d-md-flex { display: flex; }
}

/* ========================================
   CSS Grid Layouts
   ======================================== */

/* 2-column grid (equal) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* 3-column grid */
.product-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Content + Sidebar layout (wider content area) */
.content-sidebar-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

/* Sidebar + Content layout (sidebar on left) */
.sidebar-content-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 992px) {
    .product-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-sidebar-grid,
    .sidebar-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .product-grid,
    .product-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: var(--background-white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color-light, #e5e5e5);
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color-light, #e5e5e5);
    background-color: var(--background-color, #f8f9fa);
}

/* ========================================
   Alerts
   ======================================== */

.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert--danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert--warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert--info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Bootstrap-style alert aliases */
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ========================================
   Badges
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.badge--primary {
    background-color: var(--primary-color, #213a86);
    color: #ffffff;
}

.badge--success {
    background-color: var(--success-button-color, #4da422);
    color: #ffffff;
}

.badge--danger {
    background-color: var(--danger-button-color, #fc3832);
    color: #ffffff;
}

.badge--warning {
    background-color: var(--warning-button-color, #ffb400);
    color: #1a1a1a;
}

.badge--info {
    background-color: var(--info-button-color, #00b8d8);
    color: #ffffff;
}

.badge--secondary {
    background-color: #6c757d;
    color: #ffffff;
}

/* Bootstrap-style badge aliases */
.badge-primary { background-color: var(--primary-color, #213a86); color: #fff; }
.badge-secondary { background-color: #6c757d; color: #fff; }
.badge-success { background-color: var(--success-button-color, #4da422); color: #fff; }
.badge-danger { background-color: var(--danger-button-color, #fc3832); color: #fff; }
.badge-warning { background-color: var(--warning-button-color, #ffb400); color: #1a1a1a; }
.badge-info { background-color: var(--info-button-color, #00b8d8); color: #fff; }

/* ========================================
   Image Banner Section
   ======================================== */

.image-banner-section {
    width: 100%;
    overflow: hidden;
}

.image-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Banner Carousel — horizontal sliding, 3 images visible */
.image-banner-carousel {
    position: relative;
    overflow: hidden;
}

.banner-carousel-track {
    display: flex;
    will-change: transform;
}

.banner-carousel-slide {
    flex: 0 0 calc(100% / var(--carousel-visible, 3));
    box-sizing: border-box;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.banner-carousel-slide .image-banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
}

.banner-carousel-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s;
}

.banner-carousel-dots button.active {
    background: var(--primary-color, #213a86);
    transform: scale(1.2);
}

.banner-carousel-dots button:hover {
    background: var(--primary-color, #213a86);
    opacity: 0.7;
}

/* Carousel display styles */

/* Separated: space between slides with thin divider lines */
.carousel-style-separated .banner-carousel-slide {
    padding: 0 8px;
}
.carousel-style-separated .banner-carousel-slide .image-banner-img,
.carousel-style-separated .banner-carousel-slide .banner-slide-link {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: 100%;
}
.carousel-style-separated .banner-carousel-slide .image-banner-img,
.carousel-style-separated .banner-carousel-slide .banner-slide-link img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cards: each slide in a rounded card with border and shadow */
.carousel-style-cards {
    padding: 20px 0;
}
.carousel-style-cards .banner-carousel-slide {
    padding: 20px;
}
.carousel-style-cards .banner-carousel-slide .image-banner-img,
.carousel-style-cards .banner-carousel-slide .banner-slide-link {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: 100%;
}
.carousel-style-cards .banner-carousel-slide .image-banner-img,
.carousel-style-cards .banner-carousel-slide .banner-slide-link img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Banner links */
.banner-slide-link {
    position: absolute;
    inset: 0;
    display: block;
    text-decoration: none;
    color: inherit;
    z-index: 1;
}

.banner-slide-link img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-static-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

