/**
 * EZ Services Display - Frontend Styles
 * Theme-agnostic styles compatible with Twenty Twenty-Five and any WordPress theme
 */

/* Service Grid */
.ez-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

.ez-services-grid.cols-1 {
    grid-template-columns: 1fr;
}

.ez-services-grid.cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.ez-services-grid.cols-3 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.ez-services-grid.cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.product-wrap {
    margin: 0;
}

.product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: #999;
}

.product-media {
    position: relative;
    overflow: hidden;
    margin: 0;
    background: #f5f5f5;
}

.product-media img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.product-card:hover .product-media img {
    transform: scale(1.08);
}

.product-label-group {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    gap: 6px;
}

.product-label {
    display: inline-block;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-label.label-new {
    background-color: #10b981;
    color: #fff;
}

.product-label.label-sale {
    background-color: #ef4444;
    color: #fff;
}

/* Service Details */
.product-details {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 12px;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.product-brand a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s;
}

.product-brand a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.product-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.product-name a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.product-name a:hover {
    color: #3b82f6;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 1rem;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.product-meta .service-duration,
.product-meta .service-capacity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.product-meta i {
    font-size: 16px;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
    margin: auto 0 0 0;
}

.product-price del {
    color: #9ca3af;
    font-size: 18px;
    margin-right: 8px;
    font-weight: 400;
}

.product-price ins {
    text-decoration: none;
}

/* Booking Form */
.ez-booking-form {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.ez-booking-form form.cart {
    display: flex !important;
    flex-direction: column !important;
}

.booking-date-picker {
    margin-bottom: 0;
    width: 100%;
}

.booking-date-picker label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 15px;
    color: #1f2937;
}

.booking-date-picker input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.booking-date-picker input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Time slots section - appears after date picker */
.booking-time-slots {
    margin-top: 1.5rem !important;
    padding-top: 1.5rem !important;
    border-top: 2px solid #e5e7eb !important;
}

.booking-time-slots label {
    display: block;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 15px;
    color: #1f2937;
}

.time-slots-container {
    min-height: 60px;
}

.time-slots-container .loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 15px;
}

.time-slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.time-slot {
    padding: 10px 16px;
    border: 2px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: #374151;
    flex: 0 0 auto;
    min-width: 100px;
}

.time-slot:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.time-slot.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.no-slots {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    background: #fff;
    border-radius: 6px;
}

.error {
    padding: 1.5rem;
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
}

/* Add to Cart button always at bottom */
.single_add_to_cart_button {
    margin-top: 1.5rem !important;
    margin-bottom: 0 !important;
    display: block !important;
    width: 100% !important;
    clear: both !important;
}

/* Product Gallery */
.product-gallery {
    margin-bottom: 2rem;
}

.product-single-carousel {
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.product-single-carousel .product-image {
    margin: 0;
}

.product-single-carousel img {
    width: 100%;
    height: auto;
    display: block;
}

/* Service Extras */
.service-extras {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.service-extras h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
}

.service-extras-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-extras-list li {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.service-extras-list li strong {
    color: #1f2937;
    font-weight: 600;
}

.service-extras-list li p {
    margin: 0.5rem 0 0 0;
    color: #6b7280;
    font-size: 14px;
}

/* Offers */
.product-offer .product-label.label-top {
    top: 10px;
    left: 10px;
    right: auto;
}

.offer-savings {
    margin: 1rem 0;
}

.offer-savings .badge {
    padding: 8px 15px;
    font-size: 14px;
}

.offer-contents {
    margin-top: 3rem;
}

.offer-items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.offer-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

.offer-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.offer-item-details h4 {
    font-size: 15px;
    margin-bottom: 5px;
}

.offer-item-details .price {
    font-size: 16px;
    font-weight: 600;
    color: #27ae60;
}

.offer-item-details .duration {
    font-size: 13px;
    color: #777;
    margin-left: 10px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
    font-family: inherit;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}

.btn-primary:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-outline-primary {
    background: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background: #3b82f6;
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-rounded {
    border-radius: 100px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.product-action .btn {
    margin-top: auto;
}

/* Pagination */
.ez-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 2rem 0;
    padding: 1rem 0;
}

.ez-pagination a,
.ez-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #374151;
    background: #fff;
    transition: all 0.2s;
}

.ez-pagination a:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.ez-pagination span.current {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.ez-pagination .prev,
.ez-pagination .next {
    font-weight: 600;
}

/* Single Service Page */
.product-service {
    max-width: 1200px;
    margin: 0 auto;
}

.product-service .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.product-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #1a1a1a;
}

.product-short-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.product-tab-content {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid #e5e7eb;
}

.product-tab-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-service .row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .ez-services-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .time-slots-grid {
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 85px;
    }
    
    .ez-booking-form {
        padding: 1.25rem;
    }
    
    .product-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .ez-services-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .time-slots-grid {
        gap: 8px;
    }
    
    .time-slot {
        padding: 10px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .product-price {
        font-size: 20px;
    }
}

/* Date picker improvements */
.ui-datepicker {
    z-index: 9999 !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    padding: 8px !important;
    background: #fff !important;
}

.ui-datepicker-header {
    background: #3b82f6 !important;
    border-radius: 6px !important;
    margin-bottom: 8px !important;
    padding: 8px !important;
}

.ui-datepicker-title {
    color: #fff !important;
    font-weight: 600 !important;
}

.ui-datepicker-month,
.ui-datepicker-year {
    color: #fff !important;
}

.ui-datepicker-prev,
.ui-datepicker-next {
    cursor: pointer !important;
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
    color: #fff !important;
}
