/* ============================================================
Petsity Enhanced Checkout UI (Fixed Layout Version)
Style version: 1.2.0 - With Upgraded Calendar UI
Author: Petsity Custom Plugin
============================================================ */

:root {
    --accent: #E75301;
    --bg-light: #f9f9f9;
    --border: #e6e6e6;
    --text: #222;
    --muted: #777;
    --radius: 12px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    --transition: 0.25s ease;
}

/* ===========================
   Base Page Layout
   =========================== */

.petsity-checkout-page.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-light);
    padding: 40px 20px;
    font-family: "Poppins", sans-serif;
}

.petsity-checkout-title {
    font-size: 34px;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--text);
    text-align: left;
}

.petsity-checkout-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    align-items: flex-start;
}

@media (max-width: 992px) {
    .petsity-checkout-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Card Base Styles
   =========================== */

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.card:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

/* ===========================
   Provider Section
   =========================== */

.provider-box {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.provider-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #fff0e8;
    flex-shrink: 0;
}

.provider-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.provider-info .provider-name {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.provider-address {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

/* ===========================
   Available Services
   =========================== */

.available-services-section {
    margin-bottom: 20px;
}

.available-services-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.toggle-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.services-list {
    overflow-y: hidden;
    transition: max-height var(--transition);
    border-top: 1px solid #f1f1f1;
    border-radius: 8px;
    background: #fff;
}

.services-visible {
    max-height: 420px;
    overflow-y: auto;
    padding-top: 8px;
}

.services-hidden {
    max-height: 0;
    padding: 0;
}

.service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #eee;
    padding: 12px 8px;
}

.service-row:last-child {
    border-bottom: none;
}

.service-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.service-title {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}

.service-meta {
    font-size: 13px;
    color: var(--muted);
}

.service-meta .service-hours {
    font-size: 12px;
    color: var(--muted);
    margin-left: 6px;
}

.btn-add-service {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 30px;
    font-size: 14px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-add-service:hover {
    background: var(--accent);
    color: #fff;
}

/* ===== CALENDAR SECTION - MONTH GRID LAYOUT ===== */
.choose-date {
    margin-bottom: 20px;
}

.choose-date .card-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

/* Month/Year Dropdown */
.ccal-month-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 10px;
}

.ccal-prev-month,
.ccal-next-month {
    background: transparent;
    border: none;
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s ease;
}

.ccal-prev-month:hover,
.ccal-next-month:hover {
    color: #d74b00;
}

.ccal-month-dropdown {
    flex: 1;
    text-align: center;
}

.ccal-month-dropdown select {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    background: #fff;
    cursor: pointer;
    min-width: 180px;
}

/* Calendar Grid - Full Month View */
.ccal-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 20px;
}

/* Weekday Headers */
.ccal-weekday-header {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 10px 0;
    text-transform: uppercase;
}

/* Date Cell */
.ccal-date-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    min-height: 50px;
}

.ccal-date-item:hover:not(.disabled):not(.other-month) {
    border-color: var(--accent);
    background: #fff9f4;
    color: var(--accent);
}

.ccal-date-item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 700;
}

.ccal-date-item.disabled {
    background: #fafafa;
    color: #ccc;
    cursor: not-allowed;
    border-color: #f0f0f0;
}

.ccal-date-item.other-month {
    color: #ddd;
    background: transparent;
    border-color: transparent;
    cursor: default;
}

/* Selected Date Display */
.ccal-selected-date {
    background: transparent;
    padding: 12px 0;
    text-align: left;
    margin-bottom: 20px;
    font-size: 14px;
    border: none;
}

.ccal-selected-date-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

#ccalSelectedDateValue,
#ccalSelectedDayLabel {
    color: var(--text);
    font-weight: 600;
    font-size: 16px;
}

/* Time Slots */
.ccal-time-section {
    margin-top: 20px;
}

.ccal-time-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.ccal-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.ccal-time-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
    color: var(--text);
    font-weight: 500;
}

.ccal-time-item:hover:not(.disabled) {
    border-color: var(--accent);
    background: #fff9f4;
    color: var(--accent);
}

.ccal-time-item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.ccal-time-item.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e6e6e6;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .ccal-calendar-grid {
        gap: 2px;
    }

    .ccal-date-item {
        font-size: 14px;
        min-height: 45px;
    }

    .ccal-month-dropdown select {
        min-width: 150px;
        font-size: 14px;
    }
}

.ccal-date-item.available {
    background: #fff;
    border: 1px solid #E75301;
    color: #E75301;
}

.ccal-date-item.available:hover {
    background: #E75301;
    color: #fff;
}

.ccal-date-item.disabled {
    background: #f5f5f5;
    color: #bbb;
    cursor: not-allowed;
}


/* === Flatpickr Modern Theme === */
.flatpickr-calendar-wrapper {
    margin: 10px auto;
    max-width: 320px;
}

.flatpickr-calendar {
    width: 100% !important;
    font-family: "Poppins", sans-serif;
    box-shadow: none;
}

.flatpickr-day {
    border-radius: 50% !important;
    transition: all 0.2s ease;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #E75301 !important;
    color: #fff !important;
    border-color: #E75301 !important;
}

.flatpickr-day:hover {
    background: #fff3eb !important;
    border-color: #E75301 !important;
    color: #E75301 !important;
}

.flatpickr-months {
    background: #fff !important;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.flatpickr-prev,
.flatpickr-next {
    color: #E75301 !important;
    font-weight: 600;
    font-size: 18px;
}

/* --- Flatpickr Header Fix (Prevents Bootstrap interference) --- */
.flatpickr-months .flatpickr-monthDropdown-months {
    all: unset !important;
    display: inline-block !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 600;
    color: #222;
    font-size: 16px;
    cursor: pointer;
}

.flatpickr-current-month {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    font-size: 14px;
}

.flatpickr-current-month select.flatpickr-monthDropdown-months,
.flatpickr-current-month .numInputWrapper {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 16px;
    color: #222 !important;
}

.flatpickr-current-month .numInputWrapper input {
    border: none !important;
    background: transparent !important;
    color: #222 !important;
    font-weight: 600;
    font-size: 16px;
    width: 60px;
    text-align: left;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    background: transparent !important;
    color: #E75301 !important;
    font-weight: 600 !important;
    font-size: 20px !important;
    cursor: pointer !important;
    padding: 6px !important;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: #fff3eb !important;
    color: #E75301 !important;
}

.flatpickr-disabled {
    color: rgb(8 8 8 / 35%) !important;
}

/* Prevent Bootstrap select picker from hijacking */
.bootstrap-select.flatpickr-monthDropdown-months {
    display: none !important;
}

/* === Selected Date + Time Slots === */
.selected-date-box {
    margin-top: 20px;
    text-align: center;
}

.selected-date-box h5 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 15px;
}

.time-slot-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    justify-content: center;
}

.slot-btn {
    border: 1px solid #E75301;
    color: #E75301;
    background: #fff;
    border-radius: 30px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slot-btn:hover {
    background: #E75301;
    color: #fff;
}

.slot-btn.active {
    background: #E75301;
    color: #fff;
    font-weight: 600;
}

.no-slots {
    color: #888;
    font-size: 14px;
    text-align: center;
}


/* ===========================
   Cart Sidebar
   =========================== */

.checkout-right .cart-box {
    position: sticky;
    top: 24px;
}

.cart-items-wrap {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #f3f3f3;
    border-bottom: 1px solid #f3f3f3;
    margin: 10px 0;
    padding: 8px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px;
    border-bottom: 1px dashed #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 14px;
}

.cart-item-meta {
    font-size: 12px;
    color: var(--muted);
}

.btn-remove {
    background: none;
    border: 1px solid #d33;
    color: #d33;
    border-radius: 20px;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-remove:hover {
    background: #d33;
    color: #fff;
}

.cart-empty {
    text-align: center;
    color: var(--muted);
    padding: 12px;
    font-style: italic;
}

/* Totals */
.cart-totals {
    margin-top: 10px;
    font-size: 15px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}

.total-amount {
    font-size: 17px;
    font-weight: 700;
}

.btn-main {
    width: 100%;
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: 30px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: all var(--transition);
}

.btn-main:hover {
    background: #d74b00;
}

.edit-cart-link {
    display: inline-block;
    text-align: center;
    width: 100%;
    margin-top: 10px;
    color: var(--accent);
    font-size: 14px;
    text-decoration: underline;
}

/* ===========================
   Responsive Adjustments
   =========================== */

@media (max-width: 768px) {
    .petsity-checkout-title {
        font-size: 26px;
        text-align: center;
    }

    .provider-avatar img {
        width: 70px;
        height: 70px;
    }

    .btn-add-service {
        font-size: 13px;
        padding: 5px 10px;
    }

    .btn-main {
        font-size: 15px;
        padding: 12px;
    }

    .cart-totals {
        font-size: 14px;
    }

    .petsity-checkout-grid {
        grid-template-columns: 1fr;
    }

    .ccal-calendar-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .ccal-time-slots {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
}

@media (max-width: 480px) {
    .ccal-calendar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .ccal-date-item {
        font-size: 10px;
        min-height: 50px;
        gap: 2px;
        padding: 4px 2px;
    }

    .ccal-date-num {
        font-size: 14px;
    }

    .ccal-date-day {
        font-size: 9px;
    }

    .ccal-time-slots {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }

    .ccal-time-item {
        font-size: 11px;
        padding: 8px 6px;
    }

    .ccal-month-label {
        font-size: 14px;
    }

    .ccal-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}



/* ===========================
   Scrollbar Styling
   =========================== */

.services-list::-webkit-scrollbar,
.cart-items-wrap::-webkit-scrollbar {
    width: 6px;
}

.services-list::-webkit-scrollbar-thumb,
.cart-items-wrap::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
}

.services-list::-webkit-scrollbar-thumb:hover,
.cart-items-wrap::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ===========================
   Animations
   =========================== */

.services-visible {
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Mockup Parity Adjustments
   =========================== */

body .petsity-checkout-page.container {
    background: #fff;
    padding-top: 40px;
}

.petsity-checkout-title {
    font-family: "Poppins", sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #111;
    margin-bottom: 28px;
}

.provider-box.card {
    padding: 18px;
    background: #fff;
    border: 1px solid #efefef;
    border-radius: 14px;
}

.available-services-section.card,
.choose-date.card,
.cart-box.card {
    border-radius: 14px;
    border: 1px solid #efefef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cart-box.card h4 {
    font-weight: 700;
    font-size: 18px;
}

.btn-main {
    font-size: 17px;
    font-weight: 600;
    height: 50px;
}

.cart-totals hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 8px 0;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.service-row {
    padding: 14px 10px;
}

.provider-avatar img {
    border-radius: 10px;
    width: 80px;
    height: 80px;
}

.btn-pay {
    background: var(--accent);
    border: none;
    color: white;
    font-family: recoleta, sans-serif;
    padding: 12px 50px;
    font-size: 18px;
    border-radius: 25px;
    display: inline-block;
    text-decoration: none;
    text-transform: none;
    width: 100%;
    margin: 20px 0;
}

/* === Calendar Container === */

.ccal-container.card {
    margin-top: 18px;
}

.ccal-container .card-header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.ccal-date-item.unavailable.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f0f0f0;
    color: #999;
}

.ccal-date-item.available {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ccal-date-item.available:hover {
    background-color: #E75301;
    color: white;
}

.ccal-date-item.available.active {
    background-color: #E75301;
    color: white;
}