/* =========================================
   Rental Manager - Frontend Styles
   ========================================= */

/* 1. Single Product Page - Pickup Info Box */
.rental-pickup-info {
    background-color: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 0.95em;
    line-height: 1.6;
}
.rental-pickup-info .pickup-heading {
    color: #1e293b;
    display: block;
    margin-bottom: 6px;
}
.rental-pickup-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}
.rental-pickup-list li {
    margin: 0 0 8px;
}
.rental-pickup-list li:last-child {
    margin-bottom: 0;
}
.rental-pickup-info .pickup-line {
    color: #1e293b;
    font-weight: 600;
}
.rental-pickup-info .pickup-line a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.rental-pickup-info .pickup-hours {
    color: #64748b;
    font-size: 0.9em;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}
.rental-pickup-info .pickup-hours strong {
    display: inline;
    color: #475569;
}

/* Godziny odbioru – widoki mobilne: etykieta i sobota w osobnych liniach. */
@media (max-width: 767.98px) {
    .rental-pickup-info .pickup-hours strong.pickup-hours__label {
        display: block;
        margin-bottom: 2px;
    }

    .rental-pickup-info .rental-hours-sob {
        display: block;
    }

    .rental-pickup-info .rental-hours-sep {
        display: none;
    }
}

/* Single product – mobile: minimalne odstępy wokół kwadratowej miniaturki
   (breadcrumbs → zdjęcie → nazwa produktu), bo grafiki mają nadmiarowe
   białe tło u góry i u dołu. Dotyczy tylko kolumn z galerią produktu. */
@media (max-width: 767.98px) {
    main .wp-block-columns:has(.wp-block-woocommerce-product-gallery) {
        margin-top: 0 !important;
        padding-top: 0 !important;
        gap: 2px !important;
    }

    main .wp-block-woocommerce-breadcrumbs .woocommerce-breadcrumb {
        margin-bottom: 0 !important;
    }
}

/* 2. Kalendarz (własny popup, zero zależności) */
.rental-calendar-popup {
    position: absolute;
    z-index: 99999;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    padding: 10px;
    width: 288px;
    font-family: inherit;
    display: none;
}
.rental-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.rental-cal-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95em;
}
.rental-cal-nav {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    line-height: 1;
    font-size: 1.2em;
    color: #475569;
    cursor: pointer;
    padding: 0;
}
.rental-cal-nav:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.rental-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}
.rental-cal-grid.rental-cal-dow span {
    font-size: 0.75em;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px 0;
}
.rental-cal-day {
    background: #fff;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 7px 0;
    font-size: 0.9em;
    color: #1e293b;
    cursor: pointer;
}
.rental-cal-day:hover:not(.is-disabled) {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.rental-cal-day.is-disabled {
    color: #cbd5e1;
    cursor: not-allowed;
    background: #f8fafc;
    text-decoration: line-through;
}
.rental-cal-day.is-start,
.rental-cal-day.is-end {
    background: #1d4ed8;
    color: #fff;
    font-weight: 700;
}
.rental-cal-day.is-in-range {
    background: #dbeafe;
    color: #1e3a8a;
}
.rental-cal-day.rental-cal-empty {
    padding: 7px 0;
}
/* 3. Cart & Checkout - Rental Meta Data */
.rental-cart-meta {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 5px;
    display: block;
}
.rental-cart-meta dt {
    font-weight: 600;
    color: #374151;
    float: left;
    clear: left;
    margin-right: 5px;
}
.rental-cart-meta dd {
    margin-left: 0;
    margin-bottom: 4px;
}

/* 3b. Rental Fields Box (Termin wypożyczenia + Usługi) */
.rental-fields-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin: 18px 0;
    text-align: left;
}
.rental-fields-box .rental-section-title {
    margin: 0 0 10px;
    font-size: 1.05em;
    color: #1e293b;
}
.rental-fields-box .rental-dates-section {
    padding-bottom: 14px;
    border-bottom: 1px dashed #e2e8f0;
    margin-bottom: 14px;
}
.rental-date-fields {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.rental-date-field {
    flex: 1 1 180px;
}
.rental-date-field label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}
.rental-date-field input.rental-date-start,
.rental-date-field input.rental-date-end {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}
.rental-days-hint {
    font-size: 0.8em;
    color: #94a3b8;
    margin-top: 8px;
}
.rental-days-badge {
    display: inline-block;
    margin-top: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.9em;
    font-weight: 600;
}
.rental-price-estimate {
    margin-top: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.92em;
    font-weight: 500;
}
.rental-service {
    margin: 8px 0;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.rental-service .rental-service-name {
    display: block;
    font-weight: 600;
    color: #334155;
    margin: 0 0 6px;
}
.rental-service .rental-service-price {
    font-weight: 400;
    color: #16a34a;
}
.rental-service .rental-service-price.is-discount {
    color: #b91c1c;
}
.rental-service-child {
    display: inline-block;
    margin: 2px 14px 2px 0;
    font-size: 0.9em;
    color: #475569;
}
.rental-service-child input {
    margin-right: 5px;
}

/* 4. Admin Metabox (Opcjonalne usprawnienia) */
.rental-admin-notice {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 10px 15px;
    margin-bottom: 15px;
    font-size: 13px;
}

/* 5. Quantity control – motyw Greenshift dokłada "+/-" nawet gdy WooCommerce
   wymusza ilość 1 (ukryty input). Chowamy wtedy całą kontrolkę ilości. */
.quantity > input[type="hidden"] ~ button.add,
.quantity > input[type="hidden"] ~ button.sub,
.quantity:has(> input[type="hidden"]) > button {
    display: none !important;
}
