.pgbw-widget,
.pgbw-widget * {
    box-sizing: border-box;
}

.pgbw-widget {
    width: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

.pgbw-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.pgbw-row {
    width: 100%;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.pgbw-top-row,
.pgbw-bottom-row {
    align-items: flex-end;
}

.pgbw-quantity-col {
    flex: 0 0 112px;
}

.pgbw-name-col,
.pgbw-location-col,
.pgbw-date-col {
    flex: 1 1 0;
    min-width: 0;
}

.pgbw-label {
    display: block;
    margin: 0 0 5px;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: 0;
    color: #222;
}

.pgbw-optional {
    display: inline-block;
    font-size: 8px;
    font-weight: 500;
    color: #A6A6A6;
    margin-left: 2px;
}

.pgbw-input,
.pgbw-qty-control {
    width: 100%;
    height: 34px;
    border: 1px solid #E8E8E8;
    background: #fff;
    border-radius: 9px;
    outline: none;
    font-size: 10px;
    line-height: 1;
    color: #343434;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.pgbw-input {
    padding: 0 10px;
    appearance: none;
}

.pgbw-input::placeholder {
    color: #A4A4A4;
    opacity: 1;
}

.pgbw-input:focus {
    border-color: #D8D8D8;
    box-shadow: 0 0 0 2px rgba(245, 29, 71, .06);
}

.pgbw-qty-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
}

.pgbw-qty-btn {
    width: 33px;
    height: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
    line-height: 1;
    color: #343434;
    cursor: pointer;
}

.pgbw-qty-value {
    min-width: 26px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #343434;
}

.pgbw-field {
    width: 100%;
}

.pgbw-purpose-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
}

.pgbw-purpose-btn {
    min-width: 0;
    height: 29px;
    flex: 1 1 0;
    padding: 0 9px;
    border: 1px solid #E8E0E2;
    border-radius: 8px;
    background: #FAF6F7;
    color: #6E5A5E;
    font-size: 9px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .18s ease;
}

.pgbw-purpose-btn:hover {
    border-color: #F1A9B5;
}

.pgbw-purpose-btn.is-active {
    background: #FFF0F2;
    border-color: #F0D6DB;
    color: #E93C55;
}

.pgbw-date-wrap {
    position: relative;
}

.pgbw-date-wrap .pgbw-input {
    padding-right: 31px;
}

/* Prevent the browser's native date text (mm/dd/yyyy) from
   overlapping the widget's custom placeholder. */
.pgbw-date-wrap .pgbw-date {
    color: transparent;
    caret-color: transparent;
}

.pgbw-date-wrap .pgbw-date::-webkit-datetime-edit,
.pgbw-date-wrap .pgbw-date::-webkit-datetime-edit-text,
.pgbw-date-wrap .pgbw-date::-webkit-datetime-edit-month-field,
.pgbw-date-wrap .pgbw-date::-webkit-datetime-edit-day-field,
.pgbw-date-wrap .pgbw-date::-webkit-datetime-edit-year-field {
    color: transparent;
}

.pgbw-date-wrap.has-value .pgbw-date {
    color: #343434;
    caret-color: auto;
}

.pgbw-date-wrap.has-value .pgbw-date::-webkit-datetime-edit,
.pgbw-date-wrap.has-value .pgbw-date::-webkit-datetime-edit-text,
.pgbw-date-wrap.has-value .pgbw-date::-webkit-datetime-edit-month-field,
.pgbw-date-wrap.has-value .pgbw-date::-webkit-datetime-edit-day-field,
.pgbw-date-wrap.has-value .pgbw-date::-webkit-datetime-edit-year-field {
    color: #343434;
}

.pgbw-date-placeholder {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #A4A4A4;
    pointer-events: none;
}

.pgbw-date-wrap.has-value .pgbw-date-placeholder {
    display: none;
}

.pgbw-calendar-icon {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #777;
    cursor: pointer;
    border-radius: 6px;
    z-index: 3;
}

.pgbw-calendar-icon:hover {
    color: #333;
    background: rgba(0, 0, 0, .04);
}

.pgbw-calendar-icon:focus-visible {
    outline: 2px solid rgba(245, 29, 71, .35);
    outline-offset: 1px;
}

.pgbw-calendar-icon svg {
    width: 13px;
    height: 13px;
    display: block;
}

.pgbw-actions {
    align-items: stretch;
    margin-top: 0;
}

.pgbw-action-btn {
    flex: 1 1 0;
    width: 50%;
    min-height: 37px;
    padding: 7px 15px;
    border: 0;
    border-radius: 22px;
    color: #fff;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: transform .15s ease, background-color .18s ease, box-shadow .18s ease;
}

.pgbw-action-btn:hover {
    transform: translateY(-1px);
}

.pgbw-book-btn {
    background: #F51D47;
}

.pgbw-book-btn:hover {
    background: #D9163C;
}

.pgbw-wa-btn {
    background: #09A94F;
}

.pgbw-wa-btn:hover {
    background: #078C42;
}

.pgbw-status {
    display: none;
    font-size: 10px;
    color: #666;
}

.pgbw-widget input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    width: 25px;
    height: 25px;
    cursor: pointer;
}

@media (max-width: 767px) {
    .pgbw-row {
        gap: 8px;
    }

    .pgbw-quantity-col {
        flex-basis: 100px;
    }

    .pgbw-purpose-list {
        gap: 6px;
        flex-wrap: wrap;
    }

    .pgbw-purpose-btn {
        flex: 1 1 calc(33.333% - 6px);
    }

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

    .pgbw-action-btn {
        width: 100%;
        flex-basis: 100%;
    }
}

@media (max-width: 480px) {
    .pgbw-top-row,
    .pgbw-bottom-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pgbw-quantity-col,
    .pgbw-name-col,
    .pgbw-location-col,
    .pgbw-date-col {
        width: 100%;
        flex-basis: auto;
    }

    .pgbw-purpose-btn {
        flex-basis: calc(50% - 3px);
    }
}


/* Added functionality: product dropdown and pincode input.
   Existing widget dimensions/colors/layout are intentionally preserved. */
.pgbw-product {
    cursor: pointer;
}

.pgbw-product-field {
    width: 100%;
}

.pgbw-pincode {
    letter-spacing: .2px;
}

.pgbw-pincode::-webkit-outer-spin-button,
.pgbw-pincode::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
