/**
 * PharmaPrint Modal Styles - Hyva Compatible
 * 
 * These styles provide additional customization for the PharmaPrint modal
 * while maintaining Tailwind CSS compatibility
 */

/* Modal backdrop with blur effect */
.pharmaprint-modal-wrapper [x-cloak] {
    display: none !important;
}

.pharmaprint-modal-wrapper select {
     background-image: none !important;
}

sup {
    top: 0.25rem !important;
}
/* Custom scrollbar for modal content */
.pharmaprint-modal-wrapper ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.pharmaprint-modal-wrapper ::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
    margin: 8px 0;
}

.pharmaprint-modal-wrapper ::-webkit-scrollbar-thumb {
    background: #c7cbd1;
    border-radius: 3px;
}

.pharmaprint-modal-wrapper ::-webkit-scrollbar-thumb:hover {
    background: #c7cbd1;
}

/* Products scroll area - match main scrollbar */
.pharmaprint-products-scroll::-webkit-scrollbar {
    width: 6px;
}

.pharmaprint-products-scroll::-webkit-scrollbar-track {
    background: white;
    border-radius: 3px;
    margin: 8px 0;
}

.pharmaprint-products-scroll::-webkit-scrollbar-thumb {
    background: #c7cbd1;
    border-radius: 3px;
}

.pharmaprint-products-scroll::-webkit-scrollbar-thumb:hover {
    background: #c7cbd1;
}

/* Product card hover effects */
.pharmaprint-modal-wrapper .product-card {
    transition: all 0.2s ease-in-out;
}

.pharmaprint-modal-wrapper .product-card:hover {
    transform: translateY(-2px);
}

/* Selection animation */
.pharmaprint-modal-wrapper .product-card.selected {
    animation: pulse-selection 0.3s ease-in-out;
}

@keyframes pulse-selection {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Gradient backgrounds for status badges */
.pharmaprint-modal-wrapper .status-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.pharmaprint-modal-wrapper .status-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Loading skeleton animation */
.pharmaprint-modal-wrapper .skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Form input focus states */
.pharmaprint-modal-wrapper input:focus,
.pharmaprint-modal-wrapper select:focus,
.pharmaprint-modal-wrapper textarea:focus {
    box-shadow: none;
}

/* Delete button must not be affected by parent overflow */
.pharmaprint-modal-wrapper .pp-delete-btn {
    position: absolute;
    overflow: visible;
}


/* Thumbnail selection indicator */
.pharmaprint-modal-wrapper .thumbnail-selected {
    position: relative;
}

.pharmaprint-modal-wrapper .thumbnail-selected::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #10b981;
    border-radius: 2px;
}

/* Modal shadow enhancement */
.pharmaprint-modal-wrapper .modal-container {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Number input spinners customization */
.pharmaprint-modal-wrapper input[type="number"]::-webkit-inner-spin-button,
.pharmaprint-modal-wrapper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pharmaprint-modal-wrapper input[type="number"] {
    -moz-appearance: textfield;
}

/* Step indicator styles */
.pharmaprint-modal-wrapper .step-indicator {
    position: relative;
}

.pharmaprint-modal-wrapper .step-indicator::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    height: 100%;
    width: 2px;
    background: #e5e7eb;
    transform: translateX(-50%);
}

.pharmaprint-modal-wrapper .step-indicator:last-child::before {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .pharmaprint-modal-wrapper .modal-body {
        padding: 1rem;
    }

    .pharmaprint-modal-wrapper .config-grid {
        grid-template-columns: 1fr;
    }

    .pharmaprint-modal-wrapper .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation for modal open */
@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pharmaprint-modal-wrapper .modal-animate-in {
    animation: modal-slide-up 0.3s ease-out;
}

/* Price display styling */
.pharmaprint-modal-wrapper .price-display {
    font-variant-numeric: tabular-nums;
}

/* Tooltip styles */
.pharmaprint-modal-wrapper [data-tooltip] {
    position: relative;
}

.pharmaprint-modal-wrapper [data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1f2937;
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.pharmaprint-modal-wrapper [data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Selected products bar styling */
.pharmaprint-modal-wrapper .selected-products-bar {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
}

/* Pharmacy green theme accent */
.pharmaprint-modal-wrapper .pharmacy-accent {
    --pharmacy-green: #10b981;
    --pharmacy-green-dark: #059669;
    --pharmacy-green-light: #d1fae5;
}

/* Image zoom on hover */
.pharmaprint-modal-wrapper .product-image-container:hover img {
    transform: scale(1.05);
}

.pharmaprint-modal-wrapper .product-image-container img {
    transition: transform 0.2s ease-in-out;
}

/* Footer gradient */
.pharmaprint-modal-wrapper .modal-footer {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

/* Print-specific styles (for preview) */
@media print {
    .pharmaprint-modal-wrapper {
        display: none !important;
    }
}
.thumbnail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem !important;
}

@media (min-width: 640px) {
    .thumbnail {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.5rem !important;
    }
}

/* ==============================
   PZ Custom Overrides
   ============================== */

/* Fieldset containers - light shadow */
.pharmaprint-modal-wrapper .pp-fieldset {
    box-shadow: 0px 3px 5px 0px rgba(30, 53, 78, 0.05);
}

/* Footer */
.pharmaprint-modal-wrapper .pp-footer {
    background-color: #F8FAFC;
    border-top: 1px solid #E1E5EA;
}

/* Prev/Next navigation buttons */
.pharmaprint-modal-wrapper .pp-nav-btn {
    background-color: #E9F7F6;
    color: #28b1a8;
    border: none;
}

.pharmaprint-modal-wrapper .pp-nav-btn:hover:not(:disabled) {
    text-decoration: underline;
}

.pharmaprint-modal-wrapper .pp-nav-btn svg {
    color: inherit;
}

/* Delete button on product thumbnails */
.pharmaprint-modal-wrapper .pp-delete-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #E6E7EB;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #828D9E;
}

.pharmaprint-modal-wrapper .pp-delete-btn:hover {
    border-color: #f34832;
    color: #f34832;
}

.pharmaprint-modal-wrapper .pp-delete-btn svg {
    width: 14px;
    height: 14px;
}

.pharmaprint-modal-wrapper .pp-delete-btn.pp-delete-btn-active {
    border-color: #28b1a8;
}

.pharmaprint-modal-wrapper .pp-delete-btn.pp-delete-btn-active:hover {
    border-color: #f34832;
    color: #f34832;
}

/* Status messages - match site messages style */
.pharmaprint-modal-wrapper .pp-status {
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid #e2e5ea;
    font-size: 14px;
    font-weight: 600;
    background-color: #f8f9fb;
    color: #052523;
}

.pharmaprint-modal-wrapper .pp-status.success {
    background-color: #ecfdf5;
    border-color: #28b1a8;
    color: #1f9a92;
}

.pharmaprint-modal-wrapper .pp-status.error {
    background-color: #fef2f2;
    border-color: #f34832;
    color: #f34832;
}

.pharmaprint-modal-wrapper .pp-status.info {
    background-color: #f0f9ff;
    border-color: #2a648a;
    color: #2a648a;
}

/* Preview button */
.pharmaprint-modal-wrapper .pp-btn-preview {
    background: transparent;
    border: 2px solid #28b1a8;
    color: #28b1a8;
    border-radius: 10px;
    font-weight: 700;
    font-size: 18px;
}

.pharmaprint-modal-wrapper .pp-btn-preview:hover:not(:disabled) {
    filter: brightness(1.08);
}

/* Add to cart button */
.pharmaprint-modal-wrapper .pp-btn-cart {
    background-color: #28b1a8;
    color: white;
    border: 2px solid #28b1a8;
    border-radius: 10px;
    font-weight: 700;
    font-size: 18px;
}

.pharmaprint-modal-wrapper .pp-btn-cart:hover:not(:disabled) {
    filter: brightness(1.08);
}

/* Pie progress (camembert) */
.pharmaprint-modal-wrapper .pp-pie-progress {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: conic-gradient(#28b1a8 var(--pct, 0%), #d4edec var(--pct, 0%));
    flex-shrink: 0;
    position: relative;
}

.pharmaprint-modal-wrapper .pp-pie-progress::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

/* Product cards in grid - match category page style */
.pharmaprint-modal-wrapper .pp-product-card {
    display: flex;
    flex-direction: column;
}

.pharmaprint-modal-wrapper .pp-product-card > .px-3 {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pharmaprint-modal-wrapper .pp-product-card .pp-product-name {
    flex: 1;
}

.pharmaprint-modal-wrapper .pp-product-card .pp-product-image {
    background-color: white;
    padding: 8px;
    border-radius: 8px;
}

.pharmaprint-modal-wrapper .pp-product-card .pp-product-brand {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    text-decoration: underline;
    color: #052523;
}

.pharmaprint-modal-wrapper .pp-product-card .pp-product-name {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #052523;
    line-height: 1.3;
}

.pharmaprint-modal-wrapper .pp-product-card .pp-product-price {
    color: #f34832;
    font-weight: 800;
    font-size: 16px;
}

.pharmaprint-modal-wrapper .pp-product-card .pp-product-price sup {
    font-size: 9px;
    font-weight: 800;
    top: 0.15rem !important;
}