/* Product Shortcodes Styles */

/* ========================================
   SINGLE PRODUCT LAYOUT (Horizontal)
   ======================================== */

.psc-single-product {
    display: flex;
    gap: 2.5rem;
    margin: 2rem 0;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .psc-single-product {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Single Product Image */
.psc-single-image {
    flex: 0 0 45%;
    max-width: 45%;
    position: relative;
}

@media (max-width: 768px) {
    .psc-single-product {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .psc-single-image {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
    
    .psc-single-title {
        font-size: 1.5rem;
    }
    
    .psc-single-price {
        font-size: 1.15rem;
    }
    
    .psc-short-description {
        font-size: 0.9rem;
    }
    
    .psc-single-product .psc-quantity-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .psc-single-product .psc-quantity-wrapper {
        width: 100%;
        justify-content: center;
    }
    
    .psc-single-product .psc-add-to-cart {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .psc-single-product {
        margin: 1rem 0;
    }
    
    .psc-breadcrumbs {
        font-size: 0.8rem;
    }
    
    .psc-single-title {
        font-size: 1.35rem;
    }
}

.psc-single-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.psc-single-image .psc-on-sale,
.psc-single-image .psc-out-of-stock {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psc-single-image .psc-on-sale {
    background: #4CAF50;
    color: #fff;
}

.psc-single-image .psc-out-of-stock {
    background: #9e9e9e;
    color: #fff;
}

/* Single Product Details */
.psc-single-details {
    flex: 1;
}

/* Breadcrumbs */
.psc-breadcrumbs {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.psc-breadcrumbs a {
    color: #0073aa;
    text-decoration: none;
}

.psc-breadcrumbs a:hover {
    text-decoration: underline;
}

.psc-breadcrumb-sep {
    margin: 0 0.5rem;
    color: #999;
}

/* Single Product Title */
.psc-single-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    color: #333;
}

/* Single Product Price */
.psc-single-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.psc-single-price del {
    color: #999;
    font-weight: 400;
}

.psc-single-price ins {
    text-decoration: none;
    color: #e53935;
}

.psc-single-price .psc-starting-at {
    font-size: 0.9rem;
    font-weight: 400;
    color: #666;
}

/* Short Description */
.psc-short-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1.5rem;
}

.psc-short-description p {
    margin: 0 0 0.75rem;
}

.psc-short-description p:last-child {
    margin-bottom: 0;
}

/* Single Product Form */
.psc-single-product .psc-product-form {
    margin-top: 0;
}

.psc-single-product .psc-variations {
    gap: 1rem;
}

.psc-single-product .psc-attribute-row label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.psc-single-product .psc-attribute-select {
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    border-color: #ccc;
}

.psc-single-product .psc-quantity-row {
    margin-top: 1rem;
}

.psc-single-product .psc-add-to-cart {
    background: #333;
    color: #fff;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.psc-single-product .psc-add-to-cart:hover {
    background: #555;
}

.psc-single-product .psc-message {
    text-align: left;
}

/* ========================================
   GRID LAYOUT (Multiple Products)
   ======================================== */

/* Container */
.psc-products {
    margin: 2rem 0;
}

.psc-single {
    max-width: 350px;
}

/* Grid layout */
.psc-grid {
    display: grid;
    gap: 1.5rem;
}

.psc-columns-2 { grid-template-columns: repeat(2, 1fr); }
.psc-columns-3 { grid-template-columns: repeat(3, 1fr); }
.psc-columns-4 { grid-template-columns: repeat(4, 1fr); }
.psc-columns-5 { grid-template-columns: repeat(5, 1fr); }
.psc-columns-6 { grid-template-columns: repeat(6, 1fr); }

/* Tablet landscape */
@media (max-width: 1024px) {
    .psc-columns-5,
    .psc-columns-6 { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet portrait */
@media (max-width: 900px) {
    .psc-columns-4,
    .psc-columns-5,
    .psc-columns-6 { grid-template-columns: repeat(3, 1fr); }
}

/* Large mobile / small tablet */
@media (max-width: 768px) {
    .psc-columns-3,
    .psc-columns-4,
    .psc-columns-5,
    .psc-columns-6 { grid-template-columns: repeat(2, 1fr); }
    
    .psc-grid {
        gap: 1rem;
    }
    
    .psc-product-card {
        padding: 0.75rem;
    }
    
    .psc-product-title {
        font-size: 0.9rem;
    }
    
    .psc-product-price {
        font-size: 1rem;
    }
    
    .psc-card-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .psc-grid { 
        grid-template-columns: 1fr; 
    }
    
    .psc-product-card {
        padding: 1rem;
    }
    
    .psc-product-title {
        font-size: 1rem;
    }
    
    .psc-card-description {
        -webkit-line-clamp: 3;
    }
    
    .psc-quantity-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .psc-quantity-wrapper {
        width: 100%;
        justify-content: center;
    }
    
    .psc-quantity {
        flex: 1;
        max-width: 80px;
    }
    
    .psc-button {
        width: 100%;
    }
}

/* Product Card */
.psc-product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.psc-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Product Link */
.psc-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.psc-product-link:hover {
    text-decoration: none;
}

/* Product Image */
.psc-product-image {
    position: relative;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    overflow: hidden;
    background: #f9f9f9;
}

.psc-product-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.psc-product-card:hover .psc-product-image img {
    transform: scale(1.05);
}

/* Badges */
.psc-on-sale,
.psc-out-of-stock {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.psc-on-sale {
    background: #4CAF50;
    color: #fff;
}

.psc-out-of-stock {
    background: #9e9e9e;
    color: #fff;
}

/* Product Title */
.psc-product-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.4;
    color: #333;
}

/* Product Price */
.psc-product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.75rem;
}

.psc-product-price del {
    color: #999;
    font-weight: 400;
    font-size: 0.9rem;
}

.psc-product-price ins {
    text-decoration: none;
    color: #e53935;
}

.psc-starting-at {
    font-size: 0.8rem;
    font-weight: 400;
    color: #666;
}

/* Card Short Description */
.psc-card-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.psc-card-description p {
    margin: 0;
}

/* Form Area */
.psc-product-form {
    margin-top: auto;
}

/* Attribute Select (Variations) */
.psc-variations {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.psc-attribute-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.psc-attribute-row label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
}

.psc-attribute-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.psc-attribute-select:hover,
.psc-attribute-select:focus {
    border-color: #333;
    outline: none;
}

/* Touch-friendly sizing for mobile */
@media (max-width: 768px) {
    .psc-attribute-select {
        padding: 0.65rem 0.75rem;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .psc-qty-btn {
        width: 40px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    .psc-quantity {
        height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* Variation Price Display */
.psc-variation-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    min-height: 1.5rem;
}

.psc-variation-price:empty {
    display: none;
}

/* Quantity Row */
.psc-quantity-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

/* Quantity Wrapper */
.psc-quantity-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.psc-qty-btn {
    width: 32px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.psc-qty-btn:hover {
    background: #e5e5e5;
}

.psc-quantity {
    width: 45px;
    height: 36px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    -moz-appearance: textfield;
}

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

/* Add to Cart Button */
.psc-button {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.psc-add-to-cart {
    background: #333;
    color: #fff;
}

.psc-add-to-cart:hover {
    background: #555;
}

@media (max-width: 768px) {
    .psc-add-to-cart {
        padding: 0.85rem 1rem;
        font-size: 1rem;
        min-height: 44px; /* Touch target size */
    }
}

.psc-add-to-cart.psc-disabled {
    background: #ccc;
    cursor: not-allowed;
}

.psc-add-to-cart.psc-loading {
    opacity: 0.7;
    cursor: wait;
}

.psc-read-more {
    background: #f5f5f5;
    color: #333;
}

.psc-read-more:hover {
    background: #e5e5e5;
}

/* Message Area */
.psc-message {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2rem;
}

.psc-message.psc-success {
    color: #4CAF50;
}

.psc-message.psc-error {
    color: #e53935;
}

.psc-message a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* Unavailable State */
.psc-unavailable {
    text-align: center;
    padding: 0.5rem 0;
    color: #999;
}

/* Error Message */
p.psc-error {
    color: #e53935;
    padding: 1rem;
    background: #ffebee;
    border-radius: 4px;
    text-align: center;
}
