/* ============================================
   MAIN CSS - Utilities, Buttons, Cards, Forms
   TatilTour Theme v1.0.0
   ============================================ */

/* ─── Container ─── */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--container-padding);
}

/* ─── Section Spacing ─── */
.section {
    padding: 60px 0;
}

.section-sm {
    padding: 40px 0;
}

.section-lg {
    padding: 80px 0;
}

/* ─── Section Header ─── */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-bold);
    color: var(--dark);
    margin-bottom: 10px;
}

.section-header p {
    font-size: var(--fs-md);
    color: var(--dark-light);
    max-width: 600px;
    margin: 0 auto;
}

.section-header .highlight {
    color: var(--primary);
}

/* ─── Grid System ─── */
.grid {
    display: grid;
    gap: 24px;
}

.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-5 { grid-template-columns: repeat(5, 1fr); }

/* ─── Flexbox Utilities ─── */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.flex-wrap {
    flex-wrap: wrap;
}

.flex-col {
    flex-direction: column;
}

.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 32px; }

/* ─── Buttons ─── */
.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-base);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-dark {
    background: var(--dark);
    color: var(--white);
    border-color: var(--dark);
}

.btn-dark:hover {
    background: var(--dark-light);
    border-color: var(--dark-light);
    color: var(--white);
}

.btn-white {
    background: var(--white);
    color: var(--dark);
    border-color: var(--white);
}

.btn-white:hover {
    background: var(--gray-light);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--fs-sm);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--fs-md);
}

.btn-full {
    width: 100%;
}

.btn-rounded {
    border-radius: var(--radius-full);
}

.btn i {
    font-size: 0.9em;
}

/* ─── Cards ─── */
.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.card-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-body {
    padding: 16px;
}

.card-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    margin-bottom: 8px;
    color: var(--dark);
}

.card-text {
    font-size: var(--fs-sm);
    color: var(--dark-light);
    line-height: 1.5;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── Form Elements ─── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: var(--fw-medium);
    font-size: var(--fs-sm);
    color: var(--dark);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    color: var(--dark);
    background: var(--white);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.form-control::placeholder {
    color: var(--dark-light);
    opacity: 0.6;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%233e3837' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

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

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ─── Badges & Tags ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    line-height: 1;
}

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

.badge-green {
    background: rgba(39, 174, 96, 0.1);
    color: var(--green);
}

.badge-red {
    background: rgba(231, 76, 60, 0.1);
    color: var(--red);
}

.badge-blue {
    background: rgba(45, 140, 240, 0.1);
    color: var(--blue);
}

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

.badge-cream {
    background: var(--cream-light);
    color: var(--primary-dark);
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--dark-light);
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary);
    color: var(--white);
}

/* ─── Rating / Stars ─── */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.star-rating i {
    color: #f5a623;
    font-size: var(--fs-sm);
}

.star-rating .rating-number {
    margin-left: 6px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    color: var(--dark);
}

/* ─── Price Display ─── */
.price-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.price-current {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--primary);
}

.price-old {
    font-size: var(--fs-sm);
    color: var(--dark-light);
    text-decoration: line-through;
}

.price-label {
    font-size: var(--fs-xs);
    color: var(--dark-light);
}

.price-discount {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-weight: var(--fw-medium);
    font-size: var(--fs-base);
    color: var(--dark);
    background: var(--white);
    border: 1px solid var(--gray);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination .dots {
    border: none;
    background: none;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    font-size: var(--fs-sm);
    color: var(--dark-light);
}

.breadcrumb a {
    color: var(--dark-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i {
    font-size: 10px;
    color: var(--gray);
}

.breadcrumb .current {
    color: var(--dark);
    font-weight: var(--fw-medium);
}

/* ─── Alerts / Notices ─── */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--green);
    border: 1px solid rgba(39, 174, 96, 0.2);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--red);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-info {
    background: rgba(45, 140, 240, 0.1);
    color: var(--blue);
    border: 1px solid rgba(45, 140, 240, 0.2);
}

.alert-warning {
    background: rgba(253, 92, 2, 0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(253, 92, 2, 0.2);
}

/* ─── Spacing Utilities ─── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 8px; }
.pt-2 { padding-top: 16px; }
.pt-3 { padding-top: 24px; }
.pt-4 { padding-top: 32px; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 8px; }
.pb-2 { padding-bottom: 16px; }
.pb-3 { padding-bottom: 24px; }
.pb-4 { padding-bottom: 32px; }

/* ─── Text Utilities ─── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-dark { color: var(--dark); }
.text-muted { color: var(--dark-light); }
.text-white { color: var(--white); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

.fw-light { font-weight: var(--fw-light); }
.fw-normal { font-weight: var(--fw-normal); }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }

/* ─── Display Utilities ─── */
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

.overflow-hidden { overflow: hidden; }
.position-relative { position: relative; }

/* ─── Loading Spinner ─── */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ─── Fade In Animation ─── */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Overlay ─── */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ─── Tooltip ─── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--dark);
    color: var(--white);
    font-size: var(--fs-xs);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    pointer-events: none;
    margin-bottom: 8px;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ═══════ TT CARD (shared card component) ═══════ */
.tt-card {
    position: relative;
    background: var(--white, #fff);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}
.tt-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.tt-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.tt-card__img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #f5f3f1;
}
.tt-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.tt-card:hover .tt-card__img {
    transform: scale(1.05);
}
.tt-card__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5ef, #ffe8d6);
}
.tt-card__img-placeholder i {
    font-size: 36px;
    color: var(--primary, #fd5c02);
    opacity: 0.5;
}

/* Card badges */
.tt-card__badge {
    position: absolute;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    z-index: 2;
}
.tt-card__badge--stars {
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.65);
    color: #ffc107;
    backdrop-filter: blur(4px);
    padding: 3px 7px;
    font-size: 11px;
}
.tt-card__badge--stars i { font-size: 9px; }
.tt-card__badge--duration {
    top: 12px;
    left: 12px;
    background: var(--primary, #fd5c02);
    color: #fff;
}
.tt-card__badge--concept,
.tt-card__badge--type {
    background: rgba(255,255,255,0.9);
    color: var(--dark, #3e3837);
    backdrop-filter: blur(4px);
}
/* Fallback position when not inside a badge container */
.tt-card__img-wrap > .tt-card__badge--concept,
.tt-card__img-wrap > .tt-card__badge--type {
    top: 12px;
    right: 48px;
}

/* Card body */
.tt-card__body {
    padding: 16px;
}
.tt-card__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark, #3e3837);
    margin: 0 0 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tt-card__location {
    font-size: 13px;
    color: #8a8280;
    margin-bottom: 10px;
}
.tt-card__location i {
    color: var(--primary, #fd5c02);
    margin-right: 4px;
    font-size: 11px;
}
.tt-card__price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f0eeec;
}
.tt-card__price-label {
    font-size: 12px;
    color: #8a8280;
}
.tt-card__price-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary, #fd5c02);
    margin-left: auto;
}

/* List view cards */
.tt-card-grid--list .tt-card {
    display: grid;
    grid-template-columns: 260px 1fr;
}
.tt-card-grid--list .tt-card__link {
    display: contents;
}
.tt-card-grid--list .tt-card__img-wrap {
    aspect-ratio: auto;
    min-height: 180px;
}

/* ═══════ FAVORITE BUTTON ═══════ */
.tt-fav-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    color: #ccc;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.tt-fav-btn:hover {
    color: #e74c3c;
    transform: scale(1.1);
    background: #fff;
}
.tt-fav-btn--active {
    color: #e74c3c;
    background: #fff;
}
.tt-fav-btn--active:hover {
    color: #c0392b;
}

/* Pulse animation */
@keyframes tt-fav-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.tt-fav-btn--pulse {
    animation: tt-fav-pulse 0.4s ease;
}

/* ═══════ FAVORITE BADGE (header) ═══════ */
.header-link--fav {
    position: relative;
    padding: 4px 6px !important;
    gap: 0 !important;
}
.header-link--fav i {
    font-size: 14px !important;
    color: rgba(255,255,255,0.9) !important;
    transition: color 0.2s, transform 0.2s;
}
.header-link--fav:hover i {
    color: #e74c3c !important;
    transform: scale(1.15);
}
.tt-fav-badge {
    display: none;
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    pointer-events: none;
}
.tt-fav-badge--visible {
    display: inline-block;
}

/* ═══════ FORM VALIDATION STATES ═══════ */
.tt-field--error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231,76,60,0.12) !important;
}
.tt-field--valid {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 3px rgba(39,174,96,0.1) !important;
}
.tt-field-error {
    display: block;
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
    padding-left: 2px;
    animation: tt-shake 0.3s ease;
}

@keyframes tt-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* People counter */
.tt-counter {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}
.tt-counter-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f5f3f1;
    color: var(--dark, #3e3837);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.tt-counter-btn:hover {
    background: var(--primary, #fd5c02);
    color: #fff;
}
.tt-counter__value {
    width: 44px;
    text-align: center;
    border: none;
    font-size: 15px;
    font-weight: 600;
    -moz-appearance: textfield;
}
.tt-counter__value::-webkit-inner-spin-button,
.tt-counter__value::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ═══════ RESPONSIVE (cards) ═══════ */
@media (max-width: 768px) {
    .tt-card-grid--list .tt-card {
        grid-template-columns: 1fr;
    }
    .tt-card-grid--list .tt-card__img-wrap {
        aspect-ratio: 16/9;
        min-height: auto;
    }
}
