/* WP Digital Download - Frontend Styles */

/* Shop Grid */
.wpdd-shop-container {
    max-width: 1200px;
    margin: 0 auto;
}

.wpdd-shop-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.wpdd-filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.wpdd-filter-form input[type="text"],
.wpdd-filter-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

.wpdd-filter-submit {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.wpdd-filter-submit:hover {
    background: #005a87;
}

.wpdd-products-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

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

@media (max-width: 768px) {
    .wpdd-columns-2,
    .wpdd-columns-3,
    .wpdd-columns-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .wpdd-columns-3,
    .wpdd-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Product Cards */
.wpdd-product-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wpdd-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.wpdd-product-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.wpdd-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.wpdd-product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wpdd-product-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.wpdd-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.wpdd-product-title a:hover {
    color: #0073aa;
}

.wpdd-product-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.wpdd-product-creator {
    font-style: italic;
}

.wpdd-product-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.wpdd-product-price {
    margin-bottom: 15px;
    font-weight: bold;
}

.wpdd-price-free {
    color: #28a745;
    font-size: 18px;
}

.wpdd-price-regular {
    color: #333;
    font-size: 18px;
}

.wpdd-price-sale {
    color: #dc3545;
    font-size: 18px;
}

.wpdd-price-strike {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
}

.wpdd-product-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpdd-product-actions .wpdd-btn {
    width: 100%;
    justify-content: center;
}

/* Buttons */
.wpdd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
}

.wpdd-btn-primary {
    background: #0073aa;
    color: white;
}

.wpdd-btn-primary:hover {
    background: #005a87;
    color: white;
}

.wpdd-btn-view {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.wpdd-btn-view:hover {
    background: #e9ecef;
    color: #333;
}

.wpdd-btn-buy {
    background: #28a745;
    color: white;
}

.wpdd-btn-buy:hover {
    background: #218838;
    color: white;
}

.wpdd-owned-product {
    background: #17a2b8 !important;
    color: white !important;
    padding: 10px 30px !important;
}

.wpdd-owned-product:hover {
    background: #138496 !important;
    color: white !important;
}

.wpdd-btn-view:hover {
    background: #e9ecef;
    color: #333;
}

.wpdd-btn-download {
    background: #28a745;
    color: white;
}

.wpdd-btn-download:hover {
    background: #218838;
    color: white;
}

.wpdd-btn-large {
    padding: 15px 30px;
    font-size: 16px;
}

/* Customer Purchases */
.wpdd-customer-purchases {
    max-width: 1000px;
    margin: 0 auto;
}

.wpdd-purchases-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wpdd-purchases-table th,
.wpdd-purchases-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
}

.wpdd-purchases-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.wpdd-purchases-table tr:hover {
    background: #f8f9fa;
}

.wpdd-download-expired {
    color: #dc3545;
    font-style: italic;
}

/* Checkout */
.wpdd-checkout {
    max-width: 600px;
    margin: 0 auto;
}

.wpdd-checkout-product {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.wpdd-checkout-product h3 {
    margin: 0 0 15px 0;
}

.wpdd-checkout-product img {
    max-width: 150px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}

.wpdd-checkout-price {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
}

.wpdd-checkout-section {
    background: white;
    padding: 25px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wpdd-checkout-section h4 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e5e9;
}

.wpdd-checkout-section p {
    margin-bottom: 15px;
}

.wpdd-checkout-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.wpdd-checkout-section input[type="text"],
.wpdd-checkout-section input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.wpdd-checkout-section input[type="checkbox"] {
    margin-right: 8px;
}

/* Thank You Page */
.wpdd-thank-you {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.wpdd-order-details {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.wpdd-order-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: left;
}

.wpdd-download-section {
    margin: 30px 0;
}

.wpdd-download-section h3 {
    color: #28a745;
    margin-bottom: 15px;
}

/* Pagination */
.wpdd-pagination {
    text-align: center;
    margin: 40px 0;
}

.wpdd-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    text-decoration: none;
    border: 1px solid #dee2e6;
    color: #495057;
    border-radius: 4px;
    transition: all 0.3s;
}

.wpdd-pagination .page-numbers:hover,
.wpdd-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Responsive */
@media (max-width: 768px) {
    .wpdd-shop-filters .wpdd-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .wpdd-filter-form input,
    .wpdd-filter-form select {
        min-width: auto;
        width: 100%;
    }
    
    .wpdd-purchases-table {
        font-size: 14px;
    }
    
    .wpdd-purchases-table th,
    .wpdd-purchases-table td {
        padding: 10px;
    }
    
    .wpdd-checkout-section {
        padding: 20px;
    }
}

/* No products message */
.wpdd-no-products {
    text-align: center;
    color: #666;
    font-size: 18px;
    margin: 50px 0;
}

/* Login required message */
.wpdd-login-required {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

.wpdd-login-required a {
    color: #856404;
    font-weight: bold;
}

/* License Key Display */
.wpdd-license-row {
    background: #f8f9fa;
}

.wpdd-license-cell {
    padding: 8px 12px !important;
    border-top: 1px solid #ddd;
}

.wpdd-license-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
}

.wpdd-license-info small {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.wpdd-license-key {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #ddd;
    color: #333;
}

.wpdd-copy-license {
    background: #0073aa;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.wpdd-copy-license:hover {
    background: #005a87;
}

.wpdd-copy-license i {
    font-size: 11px;
}