/* Medicine Refills Page */
.medicine-refills-page h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #007cba;
    letter-spacing: 0.5px;
}

/* Refill Cards Container */
.refill-cards-container {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

/* Refill Subscription Cards */
.refill-subscription-card {
    background: white;
    border: 1px solid #007cba;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 124, 186, 0.08);
    transition: box-shadow 0.3s ease;
    width: 75%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Item Status Badges */
.item-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
}

.item-status-badge.status-active {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.item-status-badge.status-paused {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.item-status-badge.status-cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Item Controls */
.item-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.item-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.item-control-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.item-control-btn .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

.pause-item-btn {
    border-color: #ffc107;
    color: #856404;
}

.pause-item-btn:hover {
    background: #fff3cd;
    border-color: #ffb300;
}

.resume-item-btn {
    border-color: #28a745;
    color: #155724;
}

.resume-item-btn:hover {
    background: #d4edda;
    border-color: #20c997;
}

.change-frequency-btn {
    border-color: #007cba;
    color: #004085;
}

.change-frequency-btn:hover {
    background: #cce7ff;
    border-color: #0056b3;
}

/* Modal Controls */
.modal-controls {
    justify-content: flex-start;
    margin-top: 12px;
}

.modal-controls .item-control-btn {
    padding: 6px 12px;
    font-size: 12px;
}

.subscription-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subscription-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e3f7ff;
}

.subscription-actions {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.subscription-actions button {
    min-width: 120px;
    justify-content: center;
    display: inline-flex;
    margin-top: -10px;
}

.subscription-items h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #007cba;
    margin-bottom: 8px;
}

.subscription-items .first-item {
    position: relative;
    border-radius: 8px;
    margin-bottom: 8px;
}

.items-count {
    position: absolute;
    right: 6px;
    top: 10%;
    transform: translateY(-50%);

}

.items-count-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: #007cba;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.see-all-items {
    background: none;
    border: none;
    color: #007cba;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.2s ease;
}

.see-all-items:hover {
    color: #005a8c;
}

/* Modal Styles */
.items-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.items-modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.items-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e3f7ff;
}

.items-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    color: #666;
    font-size: 24px;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

.items-modal-content {
    padding-right: 8px;
}

.items-modal-content .refill-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

/* Refill Items */
.refill-item.modern-refill-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f6fafd;
    border: 1px solid #e3f7ff;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 1px 4px rgba(0, 124, 186, 0.04);
    width: 100%;
    box-sizing: border-box;
}

.refill-item.modern-refill-item.first-item {
    position: relative;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.refill-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e3f7ff;
    box-shadow: 0 1px 4px rgba(0, 124, 186, 0.07);
    margin-right: 8px;
}

.item-details {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    flex-wrap: wrap;
}

.refill-product-name {
    font-weight: bold;
    color: #333;
    font-size: 16px;
    margin-right: 8px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.item-meta-details {
    color: #555;
    font-size: 15px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.next-refill-date {
    color: #007cba;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
}

.calendar-icon {
    font-size: 16px;
    vertical-align: middle;
}

@media screen and (min-width: 768px) {
    .refill-item.modern-refill-item {
        padding: 14px 18px;
        font-size: 15px;
        gap: 16px;
    }

    .refill-item img {
        width: 48px;
        height: 48px;
    }
}

.refill-item a {
    text-decoration: none;
    color: #000;
    font-weight: 400;
    font-size: small;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    line-height: 1.4;
}

.status-active {
    background: #e8f7ee;
    color: #0a7b2f;
    border: 1px solid #a3e4b7;
}

.status-paused {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.modern-btn {
    background: linear-gradient(90deg, #007cba 0%, #00b4d8 100%);
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    min-width: 140px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.12);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

@media screen and (min-width: 768px) {
    .modern-btn {
        width: auto;
        padding: 12px 28px;
        min-width: 180px;
        font-size: 15px;
    }
}

.modern-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.modern-btn.loading {
    background: linear-gradient(90deg, #006da3 0%, #0095b4 100%);
}

.loading-spinner {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.modern-btn:hover {
    background: linear-gradient(90deg, #00b4d8 0%, #007cba 100%);
    box-shadow: 0 4px 16px rgba(0, 124, 186, 0.15);
}

.edit-subscription {
    background: #ffc107 !important;
    color: #333 !important;
}

/* No Refills State */
.no-refills {
    text-align: center;
}

.no-refills h3 {
    color: #007cba;
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.no-refills p {
    color: #555;
    font-size: 1rem;
    margin-bottom: 18px;
}

/* Existing Refills */
.order-existing-refills {
    margin: 30px 0;
    padding: 25px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.order-existing-refills h3 {
    margin: 0 0 20px 0;
    color: #007cba;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-existing-refills h3 .emoji {
    font-size: 20px;
}

.refill-subscription-card {
    background: white;
    border: 1px solid #007cba;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0, 124, 186, 0.08);
    transition: box-shadow 0.3s ease;
    width: 600px;
    max-width: 100%;
    box-sizing: border-box;
}

.refill-subscription-card:hover {
    box-shadow: 0 4px 16px rgba(0, 124, 186, 0.12);
}

.subscription-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e3f7ff;
}

@media screen and (min-width: 768px) {
    .refill-subscription-card {
        padding: 24px;
        width: 600px;
        max-width: 100%;
    }

    .refill-item img {
        width: 48px;
        height: 48px;
    }

    .subscription-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.subscription-info {
    flex: 1;
}

.subscription-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-header h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.subscription-date {
    font-size: 1.1rem;
    color: #666;
}

.subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    width: 100%;
}

.status-badge {
    margin: 4px 0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media screen and (min-width: 768px) {
    .subscription-actions {
        margin-top: 0;
        margin-left: 24px;
        width: auto;
    }
}

.status-badge.status-active {
    background: #d1edff;
    color: #0073aa;
}

.status-badge.status-paused {
    background: #fff3cd;
    color: #856404;
}

.refill-items-list {
    margin-top: 6px;
}

.refill-items-list .refill-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.items-count-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
    cursor: pointer;
}

.see-all-items {
    display: inline-flex;
    align-items: center;
    color: #007cba;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    cursor: pointer;
    text-decoration: none;
}

.see-all-items:hover {
    text-decoration: underline;
}

/* Items Modal */
.items-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.items-modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.items-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e3f7ff;
}

.items-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    font-size: 20px;
    line-height: 1;
}

.items-modal .refill-item {
    margin-bottom: 8px;
}

.hidden-items {
    display: none;
}

/* Refill Setup Form */
.order-refill-setup {
    margin: 30px 0;
    padding: 25px;
    background: #f0f8ff;
    border-radius: 8px;
    border-left: 4px solid #007cba;
}

.order-refill-setup h3 {
    margin: 0 0 20px 0;
    color: #007cba;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-refill-setup h3 .emoji {
    font-size: 20px;
}

.order-refill-setup p {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.6;
}

#refill-setup-form {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.refill-items {
    margin-bottom: 20px;
}

.refill-items h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.refill-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    background: #fafafa;
}

.refill-item-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.refill-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    min-width: 200px;
}

.refill-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.refill-controls label {
    font-size: 14px;
}

.refill-controls input[type="number"] {
    width: 60px;
    margin-left: 5px;
}

.refill-controls select {
    margin-left: 5px;
}

.refill-custom-days {
    width: 80px;
    display: none;
}

.refill-actions {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.refill-actions button[type="submit"] {
    padding: 12px 30px;
    font-size: 16px;
}

.refill-actions p {
    margin: 10px 0 0 0;
    font-size: 12px;
    color: #666;
}

/* Success Message */
.refill-setup-success {
    text-align: center;
    padding: 30px;
    background: #d1edff;
    border-radius: 6px;
    border: 1px solid #007cba;
}

.refill-setup-success h4 {
    color: #007cba;
    margin: 0 0 10px 0;
}

.refill-setup-success p {
    margin: 0 0 15px 0;
    color: #333;
}

/* Pagination Styles */
.refill-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 32px 0;
    flex-wrap: wrap;
    padding: 0 16px;
}

.refill-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e3f7ff;
    color: #007cba;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 124, 186, 0.08);
}

.refill-pagination .page-numbers.current {
    background: #007cba;
    color: #fff;
    border-color: #007cba;
}

.refill-pagination .page-numbers:hover:not(.current) {
    background: #f6fafd;
    border-color: #007cba;
}

.refill-pagination .prev,
.refill-pagination .next {
    font-size: 14px;
}

@media screen and (max-width: 480px) {
    .refill-pagination {
        gap: 6px;
    }

    .refill-pagination .page-numbers {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 14px;
    }

    .refill-pagination .prev,
    .refill-pagination .next {
        font-size: 13px;
    }
}

/* Card and popup layout improvements */
.card-details,
.popup-details {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 15px;
    color: #333;
}

.card-meta,
.popup-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
    margin-top: 2px;
}

.item-qty {
    font-size: 15px;
    color: #555;
    margin-right: 8px;
}

.item-every {
    color: #555;
    font-size: 12px;
    font-weight: 400;

}

.next-refill-date {
    color: #007cba;
    display: flex;
    align-items: center;
    gap: 4px;
}

.calendar-icon {
    font-size: 16px;
    vertical-align: middle;
}

/* Responsive mobile layout */
@media screen and (max-width: 600px) {

    .card-details,
    .popup-details {
        flex-direction: row;
        flex-wrap: wrap;
        font-size: 15px;
    }

    .card-meta,
    .popup-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        font-size: 14px;
        margin-top: 4px;
    }

    .refill-subscription-card {
        width: 100%;
        min-width: 75%;
        max-width: 100%;
        padding: 12px;
    }

    .refill-item.modern-refill-item.first-item,
    .refill-item.modern-refill-item.popup-item {
        flex-direction: column;
        align-items: flex-start;
        gap: initial;
        padding: 8px 0;
    }

    .item-details,
    .card-details,
    .popup-details {
        flex-direction: row;
        gap: 8px;
    }

    .refill-item img {
        width: 36px;
        height: 36px;
    }
}

* Enhanced Frontend Refill Setup Styles */ .refill-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.refill-controls label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.refill-controls input,
.refill-controls select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.refill-controls input:focus,
.refill-controls select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.frontend-custom-frequency {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }

    to {
        opacity: 1;
        max-height: 50px;
    }
}

.frontend-calculated-date {
    font-style: italic;
    transition: color 0.3s ease;
}

.frontend-calculated-date:hover {
    color: #0073aa !important;
}

/* Frontend Success Modal Styles */
.frontend-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.frontend-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.frontend-modal .modal-header {
    background: #0073aa;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

.frontend-modal .modal-header h2 {
    margin: 0;
    color: white;
    display: flex;
    align-items: center;
}

.frontend-modal .modal-body {
    padding: 30px;
}

.frontend-modal .success-details {
    text-align: center;
    margin-bottom: 25px;
}

.frontend-modal .subscription-id {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 10px;
}

.frontend-modal .items-count {
    color: #666;
    margin-bottom: 15px;
}

.frontend-modal .success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.frontend-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.frontend-modal .modal-actions .button {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.frontend-modal .modal-actions .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Design for Frontend */
@media (max-width: 768px) {
    .refill-controls {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .frontend-modal .modal-actions {
        flex-direction: column;
    }

    .frontend-modal .modal-actions .button {
        width: 100%;
        justify-content: center;
    }
}

/* Enhanced refill item styling */
.refill-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.refill-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.refill-item-content>label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.refill-item-content>label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Compact
 refill item styling */
.refill-item-compact {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fff;
    transition: all 0.3s ease;
    overflow: hidden;
}

.refill-item-compact:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #0073aa;
}

.refill-item-header {
    padding: 12px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.product-details {
    flex: 1;
}

.product-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.product-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.product-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.product-price {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.refill-controls-compact {
    padding: 15px;
    display: grid;
    grid-template-columns: 80px 1fr 140px;
    gap: 15px;
    align-items: start;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.control-group input,
.control-group select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
}

.control-group input:focus,
.control-group select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

.qty-input {
    max-width: 60px;
}

.date-input {
    font-size: 12px;
}

.frontend-calculated-date {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    font-style: italic;
}

.frontend-custom-frequency {
    margin-top: 4px;
    animation: slideDown 0.3s ease;
}

.frontend-custom-frequency input {
    font-size: 12px;
    padding: 4px 6px;
}

/* Responsive design for compact form */
@media (max-width: 768px) {
    .refill-controls-compact {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .product-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .product-thumbnail {
        width: 40px;
        height: 40px;
    }
}

/*
 Compact refill setup form */
.order-refill-setup-compact {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 15px 0;
    overflow: hidden;
}

.refill-setup-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.refill-setup-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refill-setup-header p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.refill-items-compact {
    padding: 20px;
}

.items-header {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.refill-actions {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.refill-actions button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refill-actions button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.refill-actions button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.refill-actions p {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #888;
}

/* Opt-in toggle styling */
.refill-optin {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.refill-optin label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.refill-optin input[type="checkbox"] {
    width: auto;
    margin: 0;
}