/**
 * PrintShop Pilot Studio - Frontend Styles
 *
 * @package PrintShopStudio
 * @since 1.0.0
 */

/* ==========================================================================
   Product Page
   ========================================================================== */

.pss-product-options {
    margin: 20px 0;
}

/* Step Progress */
.pss-step-progress {
    display: flex;
    margin-bottom: 30px;
    padding: 0;
    list-style: none;
}

.pss-step-progress li {
    flex: 1;
    text-align: center;
    position: relative;
}

.pss-step-progress li::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: #ddd;
    z-index: 0;
}

.pss-step-progress li:first-child::before {
    left: 50%;
}

.pss-step-progress li:last-child::before {
    right: 50%;
}

.pss-step-number {
    width: 30px;
    height: 30px;
    background: #ddd;
    colour: #666;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.pss-step-progress li.active .pss-step-number {
    background: #2271b1;
    colour: #fff;
}

.pss-step-progress li.completed .pss-step-number {
    background: #00a32a;
    colour: #fff;
}

.pss-step-progress li.completed .pss-step-number::after {
    content: '✓';
}

.pss-step-label {
    display: block;
    font-size: 12px;
    colour: #666;
}

.pss-step-progress li.active .pss-step-label {
    colour: #1d2327;
    font-weight: 500;
}

/* Step Sections */
.pss-step-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pss-step-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
}

.pss-step-section.collapsed {
    padding: 15px 20px;
}

.pss-step-section.collapsed h3 {
    margin-bottom: 0;
}

.pss-step-summary {
    display: inline-block;
    margin-left: 15px;
    colour: #00a32a;
    font-weight: normal;
}

/* Colour Swatches */
.pss-colour-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.pss-colour-swatch {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.pss-colour-swatch:hover {
    transform: scale(1.1);
}

.pss-colour-swatch.selected {
    border-colour: #1d2327;
}

.pss-colour-swatch.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    colour: #fff;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Two-tone swatch */
.pss-colour-swatch.two-tone {
    background: linear-gradient(135deg, var(--swatch-primary) 50%, var(--swatch-secondary) 50%);
}

/* Pattern swatch */
.pss-colour-swatch.pattern {
    background-size: cover;
    background-position: center;
}

.pss-colour-name {
    display: block;
    text-align: center;
    font-size: 11px;
    margin-top: 5px;
}

/* Mobile: Larger touch targets */
@media (max-width: 768px) {
    .pss-colour-swatch {
        width: 44px;
        height: 44px;
    }
}

/* Bulk Matrix */
.pss-bulk-matrix {
    width: 100%;
    overflow-x: auto;
}

.pss-bulk-matrix table {
    width: 100%;
    border-collapse: collapse;
}

.pss-bulk-matrix th,
.pss-bulk-matrix td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.pss-bulk-matrix th {
    background: #f0f0f0;
    font-weight: 600;
}

.pss-size-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pss-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pss-qty-btn:hover {
    background: #f0f0f0;
    border-colour: #999;
}

.pss-qty-btn:active {
    background: #e0e0e0;
}

.pss-qty-input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.pss-size-unavailable {
    colour: #999;
}

.pss-size-unavailable .pss-qty-btn,
.pss-size-unavailable .pss-qty-input {
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile Matrix */
.pss-bulk-matrix-mobile {
    display: none;
}

@media (max-width: 768px) {
    .pss-bulk-matrix-desktop {
        display: none;
    }
    
    .pss-bulk-matrix-mobile {
        display: block;
    }
    
    .pss-size-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }
    
    .pss-size-label {
        font-weight: 500;
        font-size: 16px;
    }
    
    .pss-size-qty-mobile {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .pss-size-qty-mobile .pss-qty-btn {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    .pss-size-qty-mobile .pss-qty-input {
        width: 60px;
        height: 44px;
        font-size: 18px;
    }
}

/* Matrix Summary */
.pss-matrix-summary {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.pss-matrix-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pss-matrix-summary-row:last-child {
    margin-bottom: 0;
}

.pss-summary-label {
    colour: #666;
}

.pss-summary-value {
    font-weight: 600;
}

.pss-summary-value.discount {
    colour: #00a32a;
}

/* Volume Discount Message */
.pss-volume-discount-msg {
    background: #f0f8ff;
    border-left: 4px solid #2271b1;
    padding: 12px 15px;
    margin-top: 15px;
    border-radius: 0 4px 4px 0;
}

.pss-volume-discount-msg .emoji {
    margin-right: 8px;
}

.pss-next-tier {
    font-size: 13px;
    colour: #666;
    margin-top: 5px;
}

/* Start Designing Button */
.pss-start-designing-btn {
    width: 100%;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    background: #2271b1;
    colour: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 20px;
}

.pss-start-designing-btn:hover {
    background: #135e96;
}

.pss-start-designing-btn:disabled {
    background: #ddd;
    colour: #999;
    cursor: not-allowed;
}

.pss-start-designing-btn:disabled:hover {
    background: #ddd;
}

/* Validation Messages */
.pss-validation-msg {
    colour: #d63638;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.pss-validation-msg.show {
    display: block;
}

/* ==========================================================================
   Cart Styles
   ========================================================================== */

.pss-cart-design-preview {
    width: 80px;
    height: 80px;
    background: #f9f9f9;
    border-radius: 4px;
    overflow: hidden;
}

.pss-cart-design-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pss-cart-item-details {
    font-size: 13px;
    colour: #666;
}

.pss-cart-actions {
    margin-top: 10px;
}

.pss-cart-actions a {
    margin-right: 15px;
    font-size: 13px;
}

/* ==========================================================================
   Copyright Disclaimer
   ========================================================================== */

.pss-copyright-disclaimer {
    background: #fff8e5;
    border: 1px solid #f0c36d;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
}

.pss-copyright-disclaimer h3 {
    margin-top: 0;
    colour: #856404;
}

.pss-disclaimer-checkbox {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.pss-disclaimer-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.pss-disclaimer-checkbox label {
    cursor: pointer;
    line-height: 1.5;
}

.pss-disclaimer-note {
    font-size: 13px;
    colour: #856404;
    margin-top: 15px;
}

/* ==========================================================================
   Order Confirmation
   ========================================================================== */

.pss-order-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.pss-order-confirmation h2 {
    colour: #00a32a;
    font-size: 28px;
}

.pss-order-number {
    font-size: 20px;
    margin-bottom: 30px;
}

.pss-what-happens-next {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
}

.pss-what-happens-next h3 {
    margin-top: 0;
}

.pss-order-step {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.pss-order-step-icon {
    font-size: 20px;
}

.pss-order-step-content h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
}

.pss-order-step-content p {
    margin: 0;
    colour: #666;
    font-size: 13px;
}

.pss-estimated-date {
    background: #e8f4e8;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    text-align: center;
}

.pss-estimated-date strong {
    display: block;
    font-size: 18px;
    margin-bottom: 5px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.pss-loading {
    position: relative;
    pointer-events: none;
}

.pss-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="35" stroke="%232271b1" stroke-width="8" fill="none" stroke-dasharray="164.93361431346415 56.97787143782138"><animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"/></circle></svg>') center no-repeat;
    background-size: 40px;
}

.pss-hidden {
    display: none !important;
}

/* Dispatch Date - Red styling */
strong.pss-dispatch-date {
    color: #d63638;
}

/* ==========================================================================
   Starting At Price (Custom Products)
   ========================================================================== */

.pss-starting-price {
    display: inline-block;
    font-size: inherit;
    line-height: inherit;
}

.pss-starting-price .pss-starting-amount {
    font-weight: 700;
}

/* Single product page styling */
.single-product .summary .pss-starting-price {
    font-size: 1.5em;
    color: #333;
}

.single-product .summary .pss-starting-price .pss-starting-amount {
    color: #111;
}

/* Shop loop styling */
.woocommerce ul.products li.product .pss-starting-price {
    display: block;
    font-size: 0.9em;
    color: #666;
}

.woocommerce ul.products li.product .pss-starting-price .pss-starting-amount {
    color: #333;
    font-size: 1.1em;
}

/* Ensure WooCommerce price wrapper works with starting price */
.woocommerce ul.products li.product .price .pss-starting-price,
.woocommerce-page ul.products li.product .price .pss-starting-price {
    display: block;
}

/* Sale Price Styling */
.pss-starting-price del.pss-starting-regular {
    color: #999;
    font-weight: 400;
    text-decoration: line-through;
    margin-right: 8px;
    opacity: 0.7;
}

.pss-starting-price ins.pss-starting-sale {
    color: #d63638;
    font-weight: 700;
    text-decoration: none;
}

.single-product .summary .pss-starting-price del.pss-starting-regular {
    font-size: 0.85em;
}

.single-product .summary .pss-starting-price ins.pss-starting-sale {
    font-size: 1em;
    color: #d63638;
}

/* ==========================================================================
   Shop Loop - Product Info
   ========================================================================== */

.pss-shop-loop-info {
    margin-top: 8px;
    font-size: 13px;
}

.pss-shop-loop-colours {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.pss-shop-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: default;
}

.pss-shop-loop-sizes {
    color: #666;
    font-size: 12px;
    margin-bottom: 4px;
}

.pss-shop-loop-dispatch {
    font-size: 12px;
    color: #333;
}

.pss-shop-loop-dispatch span {
    font-weight: 600;
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

