/* ── Guesty Integration – Frontend Styles ─────────────────────────────────── */

/* Grid */
.guesty-listings-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, 1fr);
}
.guesty-cols-2 { grid-template-columns: repeat(2, 1fr); }
.guesty-cols-1 { grid-template-columns: 1fr; }
@media (max-width: 900px) { .guesty-listings-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .guesty-listings-grid { grid-template-columns: 1fr; } }

/* Card */
.guesty-listing-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow .2s;
    background: #fff;
}
.guesty-listing-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,.1); }

.guesty-card-image { position: relative; }
.guesty-card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}
.guesty-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #22c55e;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.guesty-card-body { padding: 16px; }
.guesty-card-title { margin: 0 0 8px; font-size: 16px; }
.guesty-card-title a { text-decoration: none; color: inherit; }
.guesty-card-title a:hover { color: #3b82f6; }

.guesty-card-meta { display: flex; gap: 12px; font-size: 13px; color: #64748b; margin-bottom: 6px; }
.guesty-card-location { font-size: 13px; color: #94a3b8; margin: 4px 0; }
.guesty-card-price { font-size: 18px; font-weight: 700; margin: 10px 0 14px; }
.guesty-card-price small { font-size: 13px; font-weight: 400; color: #64748b; }

/* Buttons */
.guesty-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background .15s;
}
.guesty-btn-primary { background: #3b82f6; color: #fff; }
.guesty-btn-primary:hover { background: #2563eb; color: #fff; }

/* Single listing */
.guesty-listing-header { margin: 20px 0; }
.guesty-listing-header h1 { font-size: 28px; margin-bottom: 6px; }
.guesty-listing-subtitle { color: #64748b; margin: 0; }

.guesty-listing-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}
@media (max-width: 900px) { .guesty-listing-grid { grid-template-columns: 1fr; } }

.guesty-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 24px;
}
.guesty-gallery img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
}
.guesty-gallery img:first-child {
    grid-column: span 2;
    grid-row: span 2;
    height: 330px;
}
@media (max-width: 700px) { .guesty-gallery { grid-template-columns: 1fr 1fr; } }

.guesty-stats { display: flex; gap: 20px; margin-bottom: 20px; font-size: 14px; }

.guesty-description, .guesty-amenities { margin-bottom: 32px; }
.guesty-description h2, .guesty-amenities h2, .guesty-calendar-section h2 { font-size: 20px; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; margin-bottom: 16px; }
.guesty-amenities ul { columns: 2; column-gap: 20px; list-style: none; padding: 0; margin: 0; }
.guesty-amenities ul li { padding: 4px 0; font-size: 14px; }
.guesty-amenities ul li::before { content: '✓ '; color: #22c55e; }

/* Booking sidebar */
.guesty-booking-sidebar {
    position: sticky;
    top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.guesty-price-header { font-size: 22px; margin-bottom: 16px; }
.guesty-price-header span { font-size: 14px; color: #64748b; font-weight: 400; }

/* Booking Form */
.guesty-booking-form { }
.guesty-form-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guesty-form-group { margin-bottom: 14px; }
.guesty-form-group label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.guesty-form-group input,
.guesty-form-group textarea,
.guesty-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .15s;
}
.guesty-form-group input:focus,
.guesty-form-group textarea:focus { border-color: #3b82f6; outline: none; }
.guesty-form-group h3 { font-size: 16px; border-top: 1px solid #e2e8f0; padding-top: 14px; margin-top: 4px; }

.guesty-submit-booking { width: 100%; padding: 14px; font-size: 15px; margin-top: 4px; }
.guesty-submit-booking:disabled { opacity: .6; cursor: not-allowed; }

.guesty-price-estimate { background: #f0f9ff; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.guesty-est-total { font-size: 18px; float: right; }

.guesty-availability-status { margin-bottom: 10px; font-size: 13px; min-height: 20px; }
.guesty-avail-ok    { color: #16a34a; font-weight: 600; }
.guesty-avail-no    { color: #dc2626; font-weight: 600; }
.guesty-avail-check { color: #f59e0b; }

.guesty-form-response { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; display: none; }
.guesty-response-success { background: #dcfce7; color: #166534; }
.guesty-response-error   { background: #fee2e2; color: #991b1b; }

/* Calendar */
.guesty-calendar { margin-top: 8px; }
.guesty-cal-month { display: inline-block; vertical-align: top; margin: 0 20px 20px 0; }
.guesty-cal-title { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.guesty-cal-grid { display: grid; grid-template-columns: repeat(7, 36px); gap: 2px; }
.guesty-cal-header { text-align: center; font-size: 11px; font-weight: 600; color: #94a3b8; padding: 4px 0; }
.guesty-cal-day {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    cursor: default;
}
.guesty-cal-empty { }
.guesty-day-available { background: #dcfce7; color: #166534; }
.guesty-day-booked    { background: #fee2e2; color: #991b1b; }
.guesty-day-blocked   { background: #f3f4f6; color: #9ca3af; }
.guesty-day-owner_blocked { background: #fef3c7; color: #92400e; }
.guesty-day-past      { opacity: .4; }

.guesty-cal-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.guesty-legend-item { font-size: 12px; padding: 4px 10px; border-radius: 20px; }
.guesty-legend-item.guesty-day-available { background: #dcfce7; color: #166534; }
.guesty-legend-item.guesty-day-booked    { background: #fee2e2; color: #991b1b; }
.guesty-legend-item.guesty-day-blocked   { background: #f3f4f6; color: #6b7280; }

.guesty-no-results { color: #94a3b8; text-align: center; padding: 40px; }

/* ── WooCommerce Booking Fields (Product Page) ──────────────────────────── */
.guesty-wc-booking-fields {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.guesty-wc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.guesty-wc-field { margin-bottom: 12px; }
.guesty-wc-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #374151;
    margin-bottom: 4px;
}
.guesty-wc-date-input,
.guesty-wc-field input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    transition: border-color .15s;
}
.guesty-wc-date-input:focus,
.guesty-wc-field input[type="number"]:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.guesty-wc-availability-status {
    min-height: 22px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}
.guesty-wc-price-estimate {
    background: #eff6ff;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.guesty-wc-est-total { font-size: 20px; font-weight: 700; color: #1e40af; }
.guesty-wc-nights-label { color: #64748b; font-size: 12px; }

/* Cart / Checkout item meta tweaks */
.woocommerce-cart-form .guesty-meta,
.woocommerce-checkout-review-order .guesty-meta { font-size: 12px; color: #64748b; }
