/* Garnr product attributes table + info links.
   Reconstructed from storefront-garnr/assets/app.css and made self-contained
   (no dependency on the old theme's .summary / .shop_table selectors). */

/* ---- Info links (Ravelry / färgkarta / mönster) ---- */
.product-attr-links {
    margin: 0 0 5px;
    line-height: 2.5em;
}

.product-attr-links span {
    display: inline-block;
}

.product-attr-links span + span:before {
    content: "•";
    margin: 0 5px;
    display: inline-block;
}

.product-attr-links:before {
    display: inline-block;
    content: "";
    width: 65px;
    height: 25px;
    background: url(./images/tips.svg) no-repeat left center;
    vertical-align: middle;
}

.product-attr-links a {
    font-style: italic;
    text-decoration: none;
    color: inherit;
}

.product-attr-links a:hover {
    text-decoration: underline;
}

/* ---- Attributes table ---- */
.product-attributes-table {
    padding: 20px 30px;
    clear: both;
    border: 1px solid #ccc;
}

.product-attributes-table * {
    background: transparent;
}

.product-attributes-table .tables {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.product-attributes-table table {
    flex: 1;
    width: 100%;
    max-width: 100%;
    flex-basis: 220px;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0;
}

.product-attributes-table tr {
    padding: 1rem 0;
}

.product-attributes-table td {
    width: 50%;
    padding: 8px;
    font-size: 14px;
    font-weight: 400;
}

.product-attributes-table td:first-child {
    text-transform: uppercase;
    text-align: right;
    border-right: 1px solid #c1c1c1;
}

.product-attributes-table a:not(.button) {
    color: inherit;
}

/* ---- Pattern grid (below the summary) ----
   Styled to match the grouped-product cards (solvd-child
   assets/grouped-product.css): centered flex cards with a hover lift.
   Grouped uses 5 columns (.columns-5 -> flex 1 0 20%); here we want 4,
   so .product is flex 1 0 25%. Self-contained: no dependency on the
   grouped stylesheet, the parent theme, or Blocksy. */
.pattern-grid {
    clear: both;
    padding-top: 40px;
    font-size: 18px;
    font-weight: 400;
}

.pattern-grid ul.products {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 -10px;
    padding: 0;
}

/* 4 columns */
.pattern-grid ul.products li.product {
    flex: 1 0 25%;
    max-width: 25%;
    /* defeat any leftover WooCommerce float/width on .product */
    float: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 15px;
    transition: box-shadow 0.3s, background 0.3s;
}

.pattern-grid ul.products li.product > * {
    padding-left: 10px;
    padding-right: 10px;
}

.pattern-grid ul.products li.product > *:first-child {
    padding-top: 10px;
}

.pattern-grid ul.products li.product:hover {
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
    background: #fff;
}

.pattern-grid ul.products li.product a {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.pattern-grid img {
    width: 100%;
    height: auto;
    margin: 0 0 15px !important;
}

.pattern-grid .product-name {
    display: block;
}

.pattern-grid .product-name:hover {
    text-decoration: underline;
}

/* Match the grouped list's responsive step-down */
@media (max-width: 1024px) {
    .pattern-grid ul.products li.product {
        flex: 1 0 33.3333%;
        max-width: 33.3333%;
    }
}

@media (max-width: 768px) {
    .pattern-grid ul.products li.product {
        flex: 1 0 50%;
        max-width: 50%;
    }
}

/* ---- "This pattern belongs to" block ---- */
.pattern-belongs-to {
    clear: both;
    border: 1px solid #ccc;
    padding: 20px 30px 10px;
    font-size: 14px;
}

.pattern-belongs-to ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pattern-belongs-to li {
    display: flex;
    margin-bottom: 10px;
}

.pattern-belongs-to .heading {
    margin-bottom: 18px;
    text-transform: uppercase;
}

.pattern-belongs-to .image {
    width: 80px;
    margin-right: 20px;
    flex-shrink: 0;
}

.pattern-belongs-to .text {
    max-width: 300px;
}
